Immediately before the decline of the Ayyubid State, the Mamelukes controlled most of the important posts in Egypt. After the murdering of Turanshah (the last of the Ayyubid Sultans), Shajart El-Durr (wife of King Al-Saleh Ayyub) married Aybak who was one of the Bahari Mamelukes chiefs. By the assassination of Aybak in 1257, the Mamelukes had already established themselves in Egypt and were able to establish their own empire because the Mongols destroyed the Abbasid Caliphate. In 1258, the Mongol invaders put to death the last Abbasid caliph in Baghdad. In the following year, a 120,000-man Mongol army, commanded by Hulagu Khan, crossed the Euphrates and entered Syria. Meanwhile, in Egypt, the last Ayyubid sultan had died in 1250, and political control of the state had passed to the Mameluke guards whose generals seized the sultanate. The word ' Mameluke' means 'Owned' and it was given to the white male slaves, captured in war or bought in the markets. El-Aziz, the Fatimid Caliph was the first one to introduce Turkish Mamelukes into the army of Egypt. Their numbers increased more and more under the Ayyubid Dynasty, especially, in the reign of El-Malik-Es-Saleh, who brought more than 1000 Mamelukes from Western Asia. Then, they formed a private army that stayed at the Castle, which El-Malik built on the Island of Roda, on the Nile. For that reason, they had the name 'Bahari (River) Mamelukes'.
The Bahari Mamelukes
After the murder of Turanshah, the Ayyubid Dynasty came to an end and the Mamelukes became the leaders of the Near East. During the Bahari Dynasty, 25 Bahari Mamelukes ruled for almost 130 years, in which Shajart-Ed-Durr was chosen as their queen. Being once one of the slaves of as-Saleh, she is the only woman, who ruled the Muslim Country in the East and she married the Ayyubid sultan (Najm al-Din Ayyub) and gave birth to a son, called Khalil, who died at a young age. Izz al-Din Aybak was chosen to marry Shajart-Ed-Durr and to be the Sultan of Egypt and took the title of al-Malik al-Muizz. His sons and grandsons tried to keep themselves on the throne, but they failed. When En-Nasir of Aleppo (Saladin's grandson) invaded Damascus, then began to enter the Nile Valley, Aybak defeated him completely. Taking another wife from Mosul, Aybak was killed by his wife, Shajart-Ed-Durr.
The whole Muslim Empire was in danger because of the invasion of Mongols who invaded Baghdad, murdered the Caliph, invaded Syria, Gaza and destroyed everything in their way. But leading successful wars against them, Kutuz and Beybars defeated them completely.
El-Malik El-Zaher Baybars
He is the real founder of the Mameluke Empire. He helped Kutuz in defeating the Mongols after several battles. Besides, he became very famous after his wars against the Crusaders. He built a large number of mosques and called all the exiled the Abbassid Caliphs to come to Egypt, the center of the Islamic World in his time.
The Burgi Mamelukes
The Burgi Sultans were all Circassians, except two sultans who were of a Greek origin. During the Burgi Dynasty, there were elections held between the Mamelukes, rather than a hereditary system. But, 23 sultans ruled for 134 years, 6 of them ruled for 103 years. After the death of En-Nasr (the last sultan of Bahari Mamelukes), his sons fought each other on the throne. Moreover, revolts, Famine and plague led to the falling of the Bahari Dynasty. Meanwhile, Barquq (the leader of the Burgi Mamelukes) took the opportunity and dismissed the Bahari Mamelukes founding the Burgi Mamelukes. The Burgi Mamelukes extended their authority to Syria, Mecca, Jeddah and India and defeated the Mongols. Then, when Ashraf Qansuh El-Ghuri ascended the throne of Egypt, Selim I (the then Sultan of Turkey) wanted to invade Syria and Egypt. Then, El-Ghuri went with his army to the North and entered Damascus, then, to Aleppo, where the Turkish and the Mameluke armies met at an area called 'Marg Dabik' in 1516. After many battles, the Mameluke army was completely defeated and the Turkish invaded Syria and Egypt in 1517. The Mameluke Dynasty came to an end and Egypt became a province under the Turkish Empire.
Egypt Under The Mameluk Rule
The Sultan: Since there was no hereditary system, the most powerful Mamelukes used to ascend the throne, except Seyf El Din Qalawun who founded a princely house that lasted for 100 years. The Sultan depended merely on his private bodyguards and soldiers, on whom, the lands of Egypt were distributed. (2) The Colonels (Leaders) of the Army: Each army leader had a private bodyguard to protect him from his enemies and to accompany him everywhere. If any of those leaders increased his guards, this meant that he was trying to kill the Sultan to seize the throne. It is worth mentioning that Egypt enjoyed no public security at that time: shops were closed and fighting took place in the streets. (3) Posts : All the high posts were taken from the Egyptians and given to the Mamelukes, except both the religious and judicial ones.
The population of Egypt depended mainly on people from different nationalities: Egyptians, Mamelukes, Tartars (who came to Egypt in large numbers and converted into Islam during Beybars' reign) and the Franks (who were mainly merchants). As for the Mamelukes, they did not allow anyone to mingle with them. Rather, they had their own special habits and customs and, being the army leaders, they formed the ruling class. The Zimmis: While some sultans ill-treated the Zimmis and seized their jobs, some others made of them notable figures in the society and others forced the Copts to wear blue hats and the Jews yellow ones to mark them from the Muslims Celebrations and Feasts: The number of feasts increased in the time of Mamelukes, such as: A- The Anniversary of Sultan's Ascension to the Throne. B- The celebration of the Two Feasts. C- The Cutting of the Khalig Canal. Sports: The Mamluk paid great interest to sports, especially: chasing, archery, horse racing (for which, they were famous) and swimming. Baybars erected one archery ground outside the Gate of Victory at Cairo. Singing and Music: Generally speaking, the Mamelukes were interested in music and singing. But Beybars punished music fans and women singers were considered immoral. Luxurious Life: To a considerable extent, the Mamelukes lived a luxurious life. Most of them lived in palaces, decorated with gold, ivory and precious stones. The tales of "The Thousand and One Nights" represents one of the most important attestations that demonstrates the type of life they had led.
You can get more information here.