Aghmat (Tashelhit: Aɣmat, Āghmāt; pronounced locally Ughmat, Uɣmat) was an important commercial medieval Berber town in Morocco. It is today an archaeological site known as "Joumâa Aghmat". The city is located approximately 30 km south-east of Marrakech on the Ourika road. The initial "a" of the name may be unvocalized, and the name may sometimes be spelled "Ghmat", "Ghmate" or even the French-style "Rhmate" (as it appears in the Michelin Guide). According to a Berber legend, Aghmat was populated by Christian Berbers when it was conquered in 683 by the Muslim forces of Uqba ibn Nafi, a general of the Umayyad Caliphate in Syria. However, this story first surfaces almost 700 years after that date, and many historians give it no credibility. It is directly contradicted by one of the earliest Persian historians, al-Baladhuri. who states that Musa bin Nusair conquered the Sous and erected the mosque at Aghmāt. Early history After the death of Idris II in 828, Morocco was divided among his sons. Aghmat became capital of the Souss region under the Idrisid prince Abd Allah. When the Almoravids invaded from the Sahara Desert under Abd Allah ibn Yasin, Aghmāt was defended by Laqūt, leader of the Maghrawa tribe. Laqūt was defeated and the Almoravid army entered the city on 23 Rabi II 450 (27 June 1058). One of the wealthiest of Aghmāt's citizens was Laqūt's widow, Zaynab an-Nafzawiyyat, who married the Almoravid leader Abu-Bakr Ibn-Umar and placed her considerable wealth at his disposal. After Abu-Bakr returned to the Sahara Desert in 1071, Zaynab married his successor Yusuf ibn Tashfin. By 1068/1069, the population of the city had grown considerably, and Abu-Bakr decided to construct a new capital. He founded Marrakech in 1070, after which Aghmāt declined. The Almoravids continued to use it as a convenient backwater in which to exile people. These included Al Mutamid, former king of Seville and Córdoba and noted poet. His tomb remains a place of pilgrimage to this day. Aghmat was also the place of exile where Abdallah ibn Buluggin, the former king of Granada, wrote his memoirs. In the years 1126, 1127 and again in 1130, the city saw a number of battles between the Almoravid sultan Ali ibn Yusuf and the Almohad army led by Ibn Tumart and Abd al-Mu'min. Following a general rout of Almoravid forces throughout Morocco and Algeria, Abd al-Mu'min entered Aghmāt without a fight on the