The dynasties created the idea of an "imperial Maghreb" under Berber aegis, an idea that survived in some form from another. The Almoravid dynasty (c.1060–1147) originated among the Lamtuna nomadic Berber tribe belonging to the Sanhaja. They succeeded in unifying Morocco after it had been divided among several Zenata principalities in the late 10th century, and annexed the Emirate of Sijilmasa and the Barghawata (Tamesna) into their realm. Under Yusuf ibn Tashfin, the Almoravids were invited by the Muslim "taifa" princes of Al-Andalus to defend their territories from the Christian kingdoms. Their involvement was crucial in preventing the fall of Al-Andalus. After having succeeded in repelling Christian forces in 1086, Yusuf returned to Iberia in 1090 and annexed most of the major "taifas". Almoravid power began to decline in the first half of the 12th century, as the dynasty was weakened after its defeat at the battle of Ourique and because of the agitation of the Almohads. The conquest of the city of Marrakech by the Almohads in 1147 marked the fall of the dynasty. However, fragments of the Almoravids (the Banu Ghaniya) continued to struggle in the Balearic Islands and in Tunisia. The Almohad Caliphate was a Moroccan, Berber Muslim movement founded in the 12th century. The Almohad movement was started by Ibn Tumart among the Masmuda tribes of southern Morocco. The Almohads first established a Berber state in Tinmel in the Atlas Mountains in roughly 1120. They succeeded in overthrowing the ruling Almoravids in governing Morocco by 1147, when Abd al-Mu'min al-Gumi (r. 1130–1163) conquered Marrakech and declared himself Caliph. They then extended their power over all of the Maghreb by 1159. Al-Andalus followed the fate of the Maghreb and all Islamic Iberia was under Almohad rule by 1172. The Marinid dynasty was a Sunni Muslim dynasty of Zenata Berber descent that ruled Morocco from the 13th to the 15th century. The Marinids overthrew the Almohad dynasty controlling Morocco in 1244, and briefly controlled all the Maghreb in the mid-14th century.