Appointed mayor of
Alexandria after the
French evacuated Egypt in 1801,
[4] he was named
Egypt's wāli (governor) in 1804 at
Muhammad Ali's behest. Allied with
Britain's diplomatic representative, Khurshid tried to get Muhammad Ali and his
Albanians removed from Egypt, bringing in the
Delhi (madmen) troops from
Syria. Muhammad Ali managed to win the
Delhis to his side and, backed by a demonstration of
ulema and
guild leaders in
Cairo, had himself named governor of Egypt in May 1805. Khurshid, abandoned by his troops, was besieged in the
Cairo Citadel, which he left only after he saw the Ottoman
firman investing Muhammad Ali as Egypt's governor.