The Mamluk Reign ended with the Ottoman conquest of Egypt under Sultan Selim I who defeated the Mamluk forces at ar-Raydaniyah. From that time, Egypt became a province under the Ottoman Empire. Selim I left behind him Khair Bey as the sultan's vassal to rule Egypt. Khair Bey kept his court in the Citadel, the ancient residence of the rulers of Egypt. Under the next sultan, Suliman I, two chambers were created, in which, both the army and the religious authorities were represented to aid the Pasha by their deliberations. These two champers were called the 'Greater Divan' and 'Lesser Divan'.
Selim I's and his successors' attempts to extinguish the power and the influence of the Mamelukes in Egypt all went in vain. The Ottoman Turks ruled Egypt from Istanbul through Pashas whose rule did not exceed collecting taxes. The Ottomans relied on the Mamluk army whose ranks continued to expand with mercenary slaves brought in from the Caucasus.
During the latter decades of the sixteenth and the early seventeenth centuries, a series of revolts by various elements of the garrison troops broke out. In 1604, the governor Ibrahim Pasha was murdered by the soldiers, and his head set on the Bab Zuwaylah. During these years, there was also a revival within the Mamluk military structure. By the middle of the seventeenth century, political supremacy had passed to the beys.
In 1760, Ali Bey El Kabir assumed the office of Sheikh El Balad (Ruler of the Country). He gained control of the army and allied with Sheikh Daher El Omar in Palestine against the Ottoman Sultan and expelling the Ottoman Wali and announcing Egypt's independence. He issued firmans (decrees) in his own name, redirected the state revenues to his own use, and attempted to recreate the Mamluk Empire by invading Syria. He also managed to extend his influence to Hijaz and Yemen and sent an army under the leadership of Muhammad Bey Abu El-Dahab. In addition, Ali Bey tried to strengthen trade ties with Europe by encouraging trade and attempting to open the Port of Suez to European shipping. Ali Bey ruled only briefly and his successors, especially Muhammad Bey, continued his policies. In 1786, an expedition was sent by the Porte to restore the Ottoman supremacy in Egypt. After the death of Muhammad Bey, there was a struggle upon dominance among the beys. Ibrahim Bey and Murad Bey succeeded in asserting their authority and shared power in Egypt and both continued in power until the French Invasion in 1798.