The Almoravid dynasty (Arabic: المرابطون, romanized: Al-Murābiṭūn, lit. 'those from the ribats') was a Berber Muslim dynasty centered in the territory of present-day Morocco. It established an empire that stretched over the western Maghreb and al-Andalus, starting in the 1050s and lasting until its fall to the Almohads in 1147.
The Almoravids emerged from a coalition of the Lamtuna, Gudala, and Massufa, nomadic Berber tribes living in what is now Mauritania and the Western Sahara, traversing the territory between the Draa, the Niger, and the Senegal rivers. During their expansion into the Maghreb, they founded the city of Marrakesh as a capital, c. 1070. Shortly after this, the empire was divided into two branches: a northern one centered in the Maghreb, led by Yusuf ibn Tashfin and his descendants, and a southern one based in the Sahara, led by Abu Bakr ibn Umar and his descendants.