<P> The Almohads (or Almohadis) were similar to the Almoravids, in that they similarly attacked any alternative beliefs that they saw as corruptions of Islam . They managed to conquer southern Spain, and their North African empire extended further than that of the Almoravids, reaching to Egypt . </P> <P> The Hafsids were a Masmuda - Berber dynasty ruling Ifriqiya (modern Tunisia) from 1229 to 1574 . Their territories were stretched from east of modern Algeria to west of modern Libya during their zenith . </P> <P> The dynasty was named after Muhammad bin Abu Hafs a Berber from the Masmuda tribe of Morocco . He was appointed governor of Ifriqiya (present day Tunisia) by Muhammad an - Nasir, Caliph of the Almohad empire between 1198 - 1213 . The Banu Hafs, were a powerful group amongst the Almohads; their ancestor is Omar Abu Hafs al - Hentati, a member of the council of ten and a close companion of Ibn Tumart . His original name was "Fesga Oumzal", which later changed to "Abu Hafs Omar ibn Yahya al - Hentati" (also known as "Omar Inti") since it was a tradition of Ibn Tumart to rename his close companions once they had adhered to his religious teachings . The Hafsids as governors on behalf of the Almohads faced constant threats from Banu Ghaniya who were descendents of Almoravid princes which the Almohads had defeated and replaced as a ruling dynasty . </P> <P> Hafsids were Ifriqiya governors of Almohads until 1229, when they declared independence . After the split of the Hafsids from the Almohads under Abu Zakariya (1229--1249), Abu Zakariya organised the administration in Ifriqiya (the Roman province of Africa in modern Maghreb; today's Tunisia, eastern Algeria and western Libya) and built Tunis up as the economic and cultural centre of the empire . At the same time, many Muslims from Al - Andalus fleeing the Spanish Reconquista of Castile, Aragon, and Portugal were absorbed . He also conquered Tlemcen in 1242 and took Abdalwadids as his vassal . His successor Muhammad I al - Mustansir (1249--1277) took the title of Caliph . </P>

When did north africa became the middle east