The city of Ashir, 75 km south of Algiers, was founded in 935-6 by Ziri, the ruler of the Sanhaja berbers. Like the Fatimids of Mahdiya, the Sanhaja were Shi’ites and when the Fatimid caliph al-Mu’izz conquered Egypt and established a new capital, Cairo, in 970, he made the Zirid ruler his governor in the Maghreb. The principal buildings at Ashir were the palace and the congregational mosque. The palace was a rectangular enclosure, 72 metres long and 42 metres wide, with square towers and a monumental entrance. The interior consisted of a central courtyard with four identical apartments at the angles and a throne room preceded by a vestibule opposite the entrance. The plan has much in common with the smaller Fatimid ‘palace’ at Ajdabiyah. The mosque had a sanctuary seven bays wide, with five transverse aisles.