When the Almohads had captured Rabat and destroyed the kasbah of the Almoravids in the town, they began reconstructing it in AH 544 / AD 1150. They added a palace and a mosque and named it al-Mahdiyya, after their ancestor al-Mahdi Ibn Tumart. After the death of Yaqub al-Mansur (AH 595 / AD 1199) the kasbah was deserted.
The Almohads brought significant changes to the Rabat area, including the destruction and rebuilding of the Kasbah of the Udayas and turning Chellah into a royal necropolis.
This site was added to the UNESCO World Heritage Tentative List on July 20th, 2006 in the Cultural category.