[7][6][8][9] In 1150 or 1151, the Almohad ruler Abd al-Mu'min built a new kasbah (citadel) over the site of a former Almoravid ribat on the southwest shore of the Bou Regreg River, within which he included a palace and a mosque.
[9][10][11] His successor, Abu Yusuf Ya'qub al-Mansur (ruled 1184–1199), embarked on a huge project to construct a new fortified imperial capital, called al-Mahdiyya or Ribat al-Fath, on the site of what is now the old city of Rabat, with new walls extending over a vast area beyond the old kasbah.
[13] According to Joseph de La Nézière, another structure once existed on top of the gatehouse, accessed via the inner staircase terrace, but was likely demolished in the 18th century.
[9][18] The carved decoration around the horseshoe arch entrance features a curved band of interlacing geometric forms (specifically, a pattern known as darj wa ktaf, commonly seen in Moroccan architecture), set inside a rectangular frame outlined by a Qur'anic inscription frieze in Kufic Arabic script.
[9] Further above all this is another band of geometric carving, at either side of which are two ornate corbels, set above decorative engaged columns, which probably once supported a shallow roof or canopy covered in green tiles.
[9] At both corners of the horseshoe arch (at the bottom of the curved band of geometric carvings) are serpentine "S"-like forms, probably representing eels, which are a very rare motif in Almohad or Moroccan architecture.