The history of Rabat, the modern capital of Morocco, is rooted in deep antiquity, but its golden age arrived during the medieval era. The city has journeyed from a Roman settlement to an imperial capital and a pirate republic, leaving an indelible mark on its unique character. Although ancient settlements existed on the site of modern Rabat and the neighbouring city of Salé, including the Roman colony of Sala Colonia, the history of the city itself begins in the 12th century. Its founder is considered to be the Almohad ruler Abd al-Mumin, who built a fortress-ribat here around 1146 to prepare for military campaigns in Andalusia. This fortification, known as Ribat al-Fath ("Fortress of Victory"), gave the future capital its name.
The development of Rabat was determined by several important factors. A key role was played by its strategic location at the mouth of the Bou Regreg river on the Atlantic coast, making the city an ideal naval base and trading port. Political will was also of immense importance: the founder's grandson, Sultan Yaqub al-Mansur, decided in the late 12th century to transform Rabat into the capital of his vast empire. He began the construction of a grandiose mosque, of which the famous minaret — the Hassan Tower — remains, along with powerful city walls. Finally, the city received a new impulse for development in the 17th century with the arrival of the Moriscos — Muslims expelled from Spain. They brought with them Andalusian culture and crafts, and founded the pirate Republic of Salé, of which Rabat effectively became the centre.
In the early stages, Rabat was primarily a military outpost, reflected in its monumental architecture — the powerful walls and fortifications of the Kasbah of the Udayas. The economy was focused on supplying the army. Later, with the arrival of the Moriscos, the city became a major centre of maritime trade and corsairing, which brought it significant wealth. Cultural life was enriched by the synthesis of Moorish, Andalusian, and Berber traditions, which is still visible today in the architecture, music, and crafts of the old part of the city — the Medina.