Although the Almohads maintained their spiritual capital at Tinmel, in the High Atlas, they made Marrakesh the new administrative capital of their empire, and erected much monumental architecture. On top of ruins of the Almoravid palace to the west, Abd al-Mu'min erected the (first) Koutoubia Mosque, although he promptly had it torn down shortly after its completion c. 1157 because of an orientation error. The second Koutoubia mosque was probably finished by his son Abu Yusuf Yaqub al-Mansur c. 1195, with a grandiose and elaborately-adorned minaret that dominated the city's skyline. Al-Mansur also built the fortified citadel, the Kasbah (qasba), just south of the city (medina) of Marrakesh, with the Bab Agnaou gate connecting them. The Kasbah would serve as the government center of Marrakesh for centuries to come, enclosing the royal palaces, harems, treasuries, armories and barracks. It also included the a main mosque known as the Kasbah Mosque or El Mansouria Mosque (named after its founder) near Bab Agnaou. Nothing, however, remains of the original Almohad palaces or al-Mansur's great hospital.