|Common languages||Berber, Arabic|
|Government||Emirate, tribal confederacy|
|Today part of||Algeria|
The Maghrawa or Meghrawa (Arabic: المغراويون) were a large Zenata Berber tribal confederation whose cradle and seat of power was the territory located on the Chlef in the north-western part of today's Algeria, bounded by the Ouarsenis to the south, the Mediterranean Sea to the north and Tlemcen to the west. They ruled these areas on behalf of the Umayyad Caliphate of Cordoba at the end of the 10th century and during the first half of the 11th century.
The Maghrawa descend from Madghis (Medghassen). The Maghrawa are related to the Banu Ifran and the Irnyan. Several tribes descend from the Maghrawa, including the Bani bou Said, Bani Ilit (Ilent), Bani Zendak, Bani Urac (Urtezmir, Urtesminn), Bani Urcifan, Bani Laghouat, Bani Righa, Bani Sidi Mansour (Bani Mansour), A. Lahsen, etc.
Maghra means "someone who has sold his share" but also "old" in Berber. Its plural form is Aimgharen. The name Maghrawa is also used in literary Arabic, by writers such as Ibn Khaldun, the 14th-century historian of the Maghreb.
Around the beginning of the first century the Maghrawa were very numerous around Icosium, now part of Algiers but then subject to Roman client kings of Mauretania. As a security measure, Ptolemy of Mauretania relocated some of the Maghrawa people to the Chlef region. The Maghrawa occupied the region between the cities of Tlemcen and Ténès at the time of the early Muslim conquests. Most of the inhabitants of the Aurès are from this ancient tribe and the Ouarsenis is also home to the Maghrawas. The Blidéen Atlas, the Dahra Range in Tipaza, Mostaganem, Mazouna, Algiers, Cherchel, Ténès, the Chélif, Miliana and Médéa were the territory of the Maghrawa since Numidian times.
Among the tribes of Maghrawa ancestry and masters of the Western Dahra in the nineteenth century were the Achaachas, the Zerrifas, the Ouled Khellouf (where the mausoleum of the marabout Sidi Lakhdar is located), the Beni Zeroual and the Mediounas, most of them communes of the wilaya of Mostaganem.
The confederation of Maghrawa were the majority people of the central Maghreb among the Zenata (Gaetuli). Both nomadic and sedentary, the Maghrawa lived under the command of Maghrawa chiefs or Zenata. Algiers has been the territory of the Maghrawa since ancient times. The name Maghrawa was transcribed into Greek by historians. The great kingdom of the Maghrawa was located between Algiers, Cherchell, Ténès, Chlef, Miliana and Médéa. The Maghrawa imposed their domination in the Aurès.[when?] Chlef and its surroundings were populated by the Maghrawa according to Ibn Khaldun. The Maghrawa settled and extended their domination throughout the Dahra and beyond Miliana to the Tafna wadi near Tlemcen,[when?] and were found as far away as Mali.
The Maghrawa were one of the first Berber tribes to submit to Islam in the 7th century. They supported Uqba ibn Nafi in his campaign to the Atlantic in 683. They defected from Sunni Islam and became Kharijite Muslims from the 8th century, and allied first with the Idrisids, and, from the 10th century on, with the Umayyads of Córdoba in Al-Andalus. As a result, they were caught up in the Umayyad-Fatimid conflict in Morocco and Algeria. Although they won a victory over the allies of the Fatimids in 924, they soon allied with them. When they switched back to the side of Córdoba, the Zirids briefly took control over most of Morocco, and ruled on behalf of the Fatimids. In 976/977 the Maghrawa conquered Sijilmasa from the Banu Midrar, and in 980 were able to drive the Miknasa out of Sijilmasa as well.
The Maghrawa reached their peak under Ziri ibn Atiyya (to 1001), who achieved supremacy in Fez under Umayyad suzerainty, and expanded their territory at the expense of the Banu Ifran in the northern Maghreb – another Zenata tribe whose alliances had shifted often between the Fatimids and the Umayyads of Córdoba. Ziri ibn Atiyya conquered as much as he could of what is now northern Morocco and was able to achieve supremacy in Fez by 987. In 989 he defeated his enemy, Abu al-Bahār, which resulted in Ziri ruling from Zab to Sous Al-Aqsa, in 991 achieving supremacy in the western Maghreb. As a result of his victory he was invited to Córdoba by Ibn Abi 'Amir al-Mansur (also Latinized as Almanzor), the regent of Caliph Hisham II and de facto ruler of the Caliphate of Córdoba. Ziri brought many gifts and Al-Mansur housed him in a lavish palace, but Ziri soon returned to North Africa. The Banu Ifran took advantage of his absence and, under Yaddū, managed to capture Fez.[full citation needed] After a bloody struggle, Ziri reconquered Fez in 993 and displayed Yaddū's severed head on its walls.
A period of peace followed, in which Ziri founded the city of Oujda in 994 and made it his capital. However, Ziri was loyal to the Umayyad caliphs in Cordoba and increasingly resented the way that Ibn Abi 'Amir was holding Hisham II captive while progressively usurping his power. In 997 Ziri rejected Ibn Abi 'Amir's authority and declared himself a direct supporter of Caliph Hisham II. Ibn Abi 'Amir sent an invasion force to Morocco. After three unsuccessful months, Ibn Abi 'Amir's army was forced to retreat to the safety of Tangiers, so Ibn Abi 'Amir sent a powerful reinforcements under his son Abd al-Malik. The armies clashed near Tangiers, and in this battle, Ziri was stabbed by an African soldier who reported to Abd al-Malik that he had seriously wounded the Zenata leader. Abd al-Malik pressed home the advantage, and the wounded Ziri fled, hotly pursued by the Caliph's army. The inhabitants of Fez would not let him enter the city, but opened the gates to Abd al-Malik on 13 October 998. Ziri fled to the Sahara, where he rallied the Zenata tribes and overthrew the unpopular remnants of the Idrisid dynasty at Tiaret. He was able to expand his territory to include Tlemcen and other parts of western Algeria, this time under Fatimid protection. Ziri died in 1001 of the after-effects of the stab wounds. He was succeeded by his son Al-Mu'izz, who made peace with Al-Mansur, and regained possession of all his father's former territories.
A revolt against the Andalusian Umayyads was put down by Ibn Abi 'Amir, although the Maghrawa were able to regain power in Fez. Under the succeeding rulers al-Muizz (1001–1026), Hamman (1026–1039) and Dunas (1039), they consolidated their rule in northern and central Morocco.
Internal power struggles after 1060 enabled the Almoravid dynasty to conquer the Maghrawa realm in 1070 and put an end to their rule. In the mid 11th century the Maghrawa still controlled most of Morocco, notably most of the Sous and Draa River area as well as Aghmat, Fez and Sijilmasa. Later, Zenata power declined. The Maghrawa and Banu Ifran began oppressing their subjects, shedding their blood, violating their women, breaking into homes to seize food and depriving traders of their goods. Anyone who tried to ward them off was killed.
The Zenata seized some of the best lands of the Masmuda, and the Maghrawa became the dominant military caste over those they conquered.
According to Ibn Abi Zar, the chronicler of Fez, the Maghrawa improved the walls, gates and mosques of Fez, and under their rule, the city enjoyed peace. Its people were busy with construction activities and the town expanded. Security and prosperity continued up until shortly before the arrival of the Almoravids. Overall, the mass migration of the Banu Ifran and Maghrawa because of the Sanhaja expansion caused political and ethnic revolution in Morocco.
The Maghrawa were led by the Banu Khazar family, named after Khazar ibn Ḥafṣ ibn Ṣulat ibn Wazmār ibn Maghraw, who lived in the first half of the 8th century and took control of a large part of the central Maghreb after the Kharijite revolts (circa 740). His son, Muhammad ibn Khazar, defeated the Banu Ifran and captured Tlemcen circa 788, before submitting to the Idrisids sometime between 789 and 791 and becoming their ally. His son, named Khazar, had a son who was also named Muhammad and was thus also known as Muhammad ibn Khazar. The latter allied with the Umayyads of Cordoba and resisted the Fatimids for most of his life. He died in 961, reportedly over a hundred years old. He had three sons from whom many future Maghrawa leaders descended: Falful, al-Khayr, and Hamza.
Starting with Ziri Ibn Atiyya, the Maghrawa dynasty that ruled Fez and the surrounding region consisted of two family branches descended from the sons of Atiya. Atiya was a descendant of Muhammad Ibn Khazar via his son Falful. One branch descended from Ziri ibn Atiya and the other from his brother, Al-Mu'izz ibn Atiya. The rulers are listed here in chronological order:
Tamim was the last Maghrawa ruler to hold power before the Almoravids took over Fez in 1069. Note, however, that there is uncertainty about the chronology of Almoravid conquests in this region, and some authors give different dates for the Almoravid conquest of Fez.