The French withdrawal left a power vacuum in Egypt.
In 1805, a group of prominent Egyptians led by the ulema demanded the replacement of Wāli (viceroy) Ahmad Khurshid Pasha by Muhammad Ali, and the Ottomans yielded.