Main articles: Almoravid dynasty, Almohad Caliphate, and Marinid Sultanate
The empire of the Almohad dynasty at its greatest extent, circa 1212.
From the 11th century onwards, a series of Berber dynasties arose. [39][40][41] Under the Sanhaja Almoravid dynasty and the Masmuda Almohad dynasty,[42] Morocco dominated the Maghreb, al-Andalus in Iberia, and the western Mediterranean region. From the 13th century onwards the country saw a massive migration of the Banu Hilal Arab tribes. In the 13th and 14th centuries the Zenata Berber Marinids held power in Morocco and strove to replicate the successes of the Almohads through military campaigns in Algeria and Spain. They were followed by the Wattasids. In the 15th century, the Reconquista ended Muslim rule in Iberia and many Muslims and Jews fled to Morocco.[43] Portuguese efforts to control the Atlantic sea trade in the 15th century did not greatly affect the interior of Morocco even though they managed to control some possessions on the Moroccan coast but not venturing further afield inland.