Sanhaja

The Sanhaja (صنهاجة, Ṣanhaja or زناگة Znaga; Aẓnag, pl. Iẓnagen, and also Aẓnaj, pl. Iẓnajen) were once one of the largest Berber tribal confederations, along with the Zanata and Masmuda confederations. Many tribes in Algeria, Libya, Mali, Mauritania, Morocco, Niger, Senegal, Tunisia and Western Sahara bore and still carry this ethnonym, especially in its Berber form.

Other names for the population include Zenaga, Znaga, Sanhája, Sanhâdja and Senhaja.

Triad
Ibn Khaldun and others defined the Sanhaja as a grouping made up of three separate confederations, not as a single confederation. The distinction is usually made with a diacritical point placed above or below that is present in the Arabic text and often lost in English.
 * 1) Danhāǧa/Sanhaja [Sanhaja of the first type] is a confederation of: Kutāma-Zawāwa of the Kabyle mountains, including some areas like Algiers and Constantine that no longer speak Taqbaylit dialects (they occupied all the northern part of the region of the Constantincis, between the Awrās/Aures [q.v.] and the sea, that is the region containing the towns of Īkd̲j̲ān, Seṭīf, Bāg̲h̲āya, Ngaus/Niḳāwus, Tiguist/Tikist, Mīla, Constantine, Skīkda, D̲j̲id̲j̲ellī, Bellezma). This confederation includes the Massissenses of the Quinquegentiani, which we identify with the Msisna/Imsissen/Masinissa of the Massylii, on the right bank of the Soumam. The Zirid Dynasty, Hammadid Dynasty, Fatimid Caliphate,  Taifa of Alpuente, Taifa of Granada, Kingdom of Ait Abbas and Kingdom of Kuku originate from this confederation.
 * 2) Aznag/Iẓnagen (زناگة, Znaga) [Sanhaja of the second type ("Sanhaja of the veil" in reference to the blue face covering)] is a confederation of: Lemta, Massufa, Warith/Banū Warit, Lamtuna/Ilemteyen, Gudāla/Djudalla/Gazzula/Geuzula/Gaetuli, Anifa, Charta, Mandala. The Gezoula-Heskoura are defined as the brothers of the Aznag (from Teskee) as opposed to being part of the Aznag confederation. The Tebo/Tebou/Toubou speakers of Tebu are defined as Znaga according to Agnosti, Lemta by al-Yaqubi. This confederation is located primarily around the Western Sahara, Mauritania and Senegal. The Almoravids stem from the Lamtuna confederation.
 * 3) Ṣanhāja [Sanhaja of the third type] is a confederation of: Maṣmūda-(G̲h̲umāra/Hintata/Barghawata) speakers of Shilha. This confederation is located primarily in the area of the Moroccan Atlas' Shilha speakers. Some Riffians today have these tribe names (Sanhadjan Rif, as a result of the later Zenati integration into this branch of the Sanhaja under the Almohads). The Almohads and Hafsid Dynasty stem from this confederation.

Origins
Berber tribes such as the Sanhadja or Kutama are often attributed Himyarite origins by Arab historians (which the Sanhadja likely adopted themselves for political legitimacy), but other genealogical sources and modern genetic testing reveal this supposed origin to likely be a myth, given the predominant Berber Y haplogroup is E, and the predominant Arab Y haplogroup is J. The historian Al-Idrīsī presents one example of the Himyarite myth as following:

"He then traced the origin of the Ṣanhādja and Lamṭa tribes to their common male ancestor Lamṭ, son of Za‘zā‘, who was from the children (min awlād) of Ḥimyar, and thus attributed to both of them the South Arabian roots. The similar origin is also ascribed to the “brother” of Ṣanhādj and Lamṭ by maternal line, Hawwār, whose forefather was al-Muṣawwir, son of al-Muthannā, son of Kalā‘, son of Ayman, son of Sa‘īd, son of Ḥimyar. According to a legend, his and his tribe’s abode was in Hejaz, but they left it in search of lost camels, so that crossed the Nile and reached the Maghrib, where al-Muṣawwir married Tāzikāy, the mother of Ṣanhādj and Lamṭ."

History
After the arrival of the religion of Islam, the Sanhaja spread out to the borders of the Sudan as far as the Senegal River and the Niger.

Sanhaja Berbers were a large part of the Berber population. From the 9th century, Sanhaja tribes were established in the Middle Atlas range, in the Rif Mountains and on the Atlantic coast of Morocco as well as large parts of the Sanhaja, such as the Kutâma, were settled in central and eastern parts Algeria (Kabylia, Setif, Algiers, Msila) and also in northern Niger. The Kutama created the empire of the Fatimids conquering all North African countries and parts of the Middle East. The Sanhaja dynasties of the Zirids and Hammâdids controlled Ifriqiya until the 12th century and established their rule in all of the countries in the Maghreb region.

In the mid-11th century, a group of Sanhaja chieftains returning from the Hajj (pilgrimage to Mecca) invited the theologian Ibn Yasin to preach among their tribes. Ibn Yasin united the tribes in the alliance of the Almoravids in the middle of the 11th century. This confederacy subsequently established Morocco, and conquered western Algeria and Al-Andalus (part of present-day Spain).



The Sanhaja tribes would remain in roles as either exploited semi-sedentary agriculturalists and fishermen, or higher up on the social ladder, as religious (Marabout or Zawiya) tribes. Though often Arabized in culture and language, they are believed to be descended from Sanhaja Berber population present in the area before the arrival of the Arab Maqil tribes in the 12th century, which was finally subjected to domination by Arab-descended warrior castes in the 17th century Char Bouba war.

According to Mercer, the words Zenaga or Znaga (from the Berber root ẓnag or ẓnaj, giving the noun Aẓnag or Aẓnaj with the additional masculine singular prefix a-, or Taẓnagt or Taẓnajt with the additional feminine singular circumfix ta--t, or Iẓnagen or Iẓnajen with the additional masculine plural circumfix i--en, or Tiẓnagen or Tiẓnajen with the additional feminine plural circumfix ti--en) are thought to be a romanized distortion of Zenata and Sanhaja from Arabic.

Present day
The descendants of the Sanhaja and their languages are still found today in the Middle Atlas mountains, eastern Morocco, northern Morocco (Rif), western Algeria, Kabylia and Kabyle territories.

The Zenaga, a group believed to be of Gudala (the southernmost Sanhaja tribe) origin, inhabit southwestern Mauritania and parts of northern Senegal. However, they are a small population.