The process of Muhammad Ali's seizure of power in Egypt was a long three-way civil war between the Ottoman Turks, Egyptian Mamluks who had ruled Egypt for centuries, and Albanian mercenaries in the service of the Ottomans. It ended in victory for the Albanians led by Muhammad Ali of Egypt (1769–1849).
The three-way struggle followed the French invasion of Egypt by Napoleon. After the French defeat a power vacuum was created in Egypt. The Mamluks had governed Egypt before the French invasion and still retained much power. Egypt was officially a part of the Ottoman Empire and Egypt still had many Ottoman Turkish troops who had been sent to evict the French. Many of the best Ottoman troops were from Albania, then a province of the Ottoman Empire.
In March 1803, the British evacuated Alexandria leaving a power vacuum in Egypt. Muhammad Bey al-Alfi (aka Alfi Bey) (1751–1807) had accompanied the British to lobby them to help restore the power of the Mamluks. In their attempts to return to power, the Mamluks took Minia and interrupted communication between Upper and Lower Egypt.
About six weeks later, the Ottoman governor of Egypt Koca Hüsrev Mehmed Pasha, finding himself in a financial bind and unable to pay all the troops under his command, attempted to disband his Albanian bashi-bazouks (or Arnauts) without pay in order to be able to pay his regular, Turkish, soldiers. The Albanians refused to disband, and instead surrounded the house of the defterdar (finance minister), who appealed in vain to Hüsrev Pasha to satisfy their claims. Instead, the Pasha commenced an artillery bombardment from batteries located in and near his palace on the insurgent soldiers who had taken the house of the defterdar, located in the Ezbekia. The citizens of Cairo, accustomed to such occurrences, immediately closed their shops and armed themselves. The tumult in the city continued all day, and the next morning a body of troops sent out by Hüsrev Pasha failed to quell it.