The Sanhaja or Senhaja (also Zenaga, Znaga or Sanhadja; Arabic: صنهاجة Ṣanhājah, Berber: Iẓnagen) were once one of the largest Berber tribal confederations of the Maghreb, along with the Zanata and Masmuda. Many tribes and regions in the Berber world bore and still bear this name, especially in its Berber form.
The meaning of the Berber word Iẓnagen is the oasis people. Its singular form is Aẓnag, which is frequently used today as a family name by many North Africans. In Berber, the word for "oasis" is Aẓnig or Amda.
After the arrival of Islam they also spread out to the borders of the historic Sudan as far as the Senegal River and the Niger. From the 9th century Sanhaja tribes began to establish themselves in the Middle Atlas range, in the Rif Mountains and on the Atlantic coast of Morocco. A part of the Sanhaja settled in eastern Algeria and northern Niger (the Kutama), and played an important part in the rise of the Fatimids. The Sanhaja dynasties of the Zirids and Hammadids controlled Ifriqiya until the 12th century.
In the mid-11th century, a group of Sanhaja chieftains, returning from the Hajj invited the theologian ibn Yassin to preach among their tribes. Ibn Yasin then managed to unite the tribes in the alliance of the Almoravids in the middle of the 11th century. This confederacy subsequently established Morocco, conquered western Algeria, and Al-Andalus.
The descendents of the Sanhaja are found today in the Middle-Atlas and eastern Morocco, the Tuaregs Kutama in northern Niger and Mali across the Sahara, in addition to the Kutama of Kabylie in the Algerian south.
A group believed to be descendents of the Gudala (the southernmost Sanhaja tribe), still exist today in south western Mauritania and in parts of northern Senegal, though in a few numbers. (See the Zenaga people).