Madīna
Medina, the city of the Prophet, lies on a volcanic plain in the Hejaz, around al-Masjid al-Nabawi, where Muhammad is buried. In 1256 lava from the Harrat Rahat flows threatened the city and turned aside. After the Mongols took Baghdad in 1258, the Mamluk sultans of Cairo gained control of Medina. The Prophet's Mosque had burned in 1256, when a storeroom caught fire, and burned again under the Mamluks in 1481, when lightning struck it. The same age brought a revival of learning in Medina, with scholars such as Ibn Farhun.
In 1517 Selim I's conquest of Egypt brought Medina into the Ottoman Empire, which lavished money and aid on the city. In 1532 Suleiman the Magnificent had a fortress built around it with a castle held by an Ottoman garrison, and the sultans repeatedly redesigned the Prophet's Mosque. Medina swore allegiance to the first Saudi state in 1805, but in 1811 Muhammad Ali of Egypt sent an army under his son Tusun Pasha, who was beaten at al-Safra. In 1812 Tusun returned with a larger force, besieged the Saudi garrison, blew a breach in the walls with mines in November and took Medina. Under Muhammad Ali's rule the walls and the mosque were renovated, and a charitable kitchen was founded to give food and alms to the poor.