The Kasbah of the Udayas is a kasbah in Rabat, Morocco. It is located at the mouth of the Bou Regreg river opposite Salé. The edifice was built in the 12th century during the reign of the Almohad Caliphate (AD 1121-1269). When the Almohads had captured Rabat and destroyed the kasbah of the Almoravid dynasty 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.