Muhammad Ali Pasha took power in Egypt in the early nineteenth century and founded the dynasty that ruled until 1952. The mosque was built over roughly two decades from the 1830s and holds his tomb.
The man himself is the pivot of modern Egyptian history. An Ottoman commander who rose from the chaos after the French occupation ended, he became governor in 1805, destroyed the Mamluk aristocracy — most bloodily in a massacre inside this very Citadel in 1811 — and set about building a modern state: a conscript army, new industries, students sent to Europe. The mosque was his personal monument.
Its model is Istanbul: the great imperial mosques of the Ottoman capital, with a central dome carried on half-domes and slender pencil minarets. The break with Cairo's own Mamluk tradition was deliberate — a new dynasty announcing a new orientation, in architecture.
Building it required clearing part of the older Mamluk Citadel, which is one reason the site now mixes periods so abruptly.
The mosque has been restored several times, most significantly in the 1930s, when the cracked main dome had to be dismantled and rebuilt — which is why the structure is sounder than its age suggests.