Marrakesh
The Marinids never made Marrakesh a capital again, and the south slowly passed to the Hintata, a tribe of the High Atlas. When Abu al-Hasan, beaten in a civil war by his own son Abu Inan, fled to their mountains in 1350, it was the Hintata chief who sheltered the old sultan until his death; after 1358 the same chief stood behind the Marinid prince who ruled in Marrakesh. His descendants grew ever more independent, and by the early 16th century these "kings of Marrakesh" held little more than the city itself. When the Portuguese attacked it in 1515, they were driven off with the help of the Saadians.
The Saadians, sharifs from the Draa valley who had risen against the Portuguese on the coast, took the city for themselves around 1525, and Marrakesh became a capital once more. Abdallah al-Ghalib built the Ben Youssef Madrasa, the largest in the Maghreb, and after the victory over Portugal at Ksar el-Kebir in 1578 Ahmad al-Mansur raised the Badi Palace, with columns of Italian marble, to receive foreign embassies. It did not long survive his dynasty: the Alaouite sultan Moulay Isma'il had it stripped to build his new capital at Meknes.