The Qasba of the Udayas is at the mouth of the Bou Regreg River on the shore opposite Salé. Originally a small fortress was built by the Almoravids to defend against the Berghouata. The qasba as it exists today was rebuilt by the Almohads in 1150/544 AH. The mosque, Jami' al-'Atiq, built at the same time, still stands and is the oldest mosque in Rabat. The city was renamed al-Mahdiyya, after the Mahdi Ibn Tumart. At the end of the Almohad reign, the Qasba was abandoned and not inhabited again until arrival of Moors, expelled from Spain in the 17th century 17th century/11th century AH. They settled in the lower part of the qasba.
The Almohad wall that surrounds the kasbah, 2.50 m wide and 8–10 m tall, is built with ashlars and bordered by a sloping esplanade where some old cannon still stand.
Built by Ya'qub al-Mansur, the monumental gateway stands on a knoll and dominates the town. Built of red ochre freestone, it is made up of an arch flanked by two towers and bears repeated sculptural decoration on the inner façade. The spandrels of the arch are framed with a kufic inscription. Snake motifs at the springing point of the festooned arches constitute an unusual addition in Moroccan decoration. This gateway leads to a series of three square rooms separated by steps: the first is covered with a domed vault resting on squinches, the second with a dome on pendentives and the third with a barrel vault. One large and one small door open onto the inside of the fortress. A flight of stairs at the back leads to the terrace.
In 2012 the Qsaba was added to UNESCO's World Heritage List.