Kasbah of the Udayas

[4] The later caliph Yaqub 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 medina (old city) of Rabat, with new walls extending over a vast area beyond the old kasbah.

After Abu Yusuf Ya'qub's death in 1199 the mosque and the capital remained unfinished and his successors lacked the resources or the will to finish it.

About 2000 of these refugees, originally from the town of Hornachos near Badajoz, Spain, settled around Salé and occupied the kasbah, attracting between 5000 and 14,000 other Moriscos to join them.

[5][7] During this time (early 17th century) they built a broad platform on the kasbah's northeastern edge, overlooking the river, which was used for semaphore signalling.

The tower rose only 3 meters above the water and was hidden from view behind the sqala, thus allowing its canons to catch pursuing enemy ships by surprise.

[5] The Republic of Salé remained outside the control of the central government until 1666, when the 'Alawi sultan Moulay Rashid took over the area and placed the corsairs under his authority.

[3][4][8]: 171  It includes a palace or royal pavilion built by Sultan Moulay Ismail (ruled 1672–1727) at the end of the 17th century and serving today as a museum.

[11] The Kasbah, along with other historic sites in Rabat, was added to the UNESCO World Heritage Tentative List on July 20, 2006, in the cultural category.

[3] 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.

[3] 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.

Dating from Abd al-Mu'min's construction in 1150, it was largely restored in the 18th century, during the reign of Sultan Mohammed ben Abdallah, by an English corsair known as Ahmed el-Inglizi.

[5] The southern part of the kasbah includes a former pavilion or palace residence built by Sultan Moulay Ismail (ruled 1672–1727) at the end of the 17th century.

[5] In 1915, during the French Protectorate over Morocco, the building was converted into a museum on the initiative of Prosper Ricard, director of the Service des Arts Indigènes under Lyautey.

[22] It became an ethnographic museum with a collection initially made up of donations from Prosper Ricard himself, Alfred Bel, and Jean Besancenot.

[22] The museum's collection expanded to include jewellery, musical instruments, ceramics, Qur'ans and manuscripts (some as old as the 12th century), costumes, silks, and carpets, from different parts of the country.

The façade of Bab Oudaya or Bab Lakbir, the monumental Almohad gate of the Kasbah