The Berbers (autonym: Imazighen) are an indigenous ethnic group of the Maghreb region of North Africa. Following the Muslim conquest of the Maghreb, most Berber tribes eventually became Muslims. Presently, about one-sixth of the population of Maghreb speaks one of the Berber languages (mostly in Algeria and Morocco), but most of them also speak some form of Arabic. Berbers are the first non-Arab people to have established an Islamic state.
The region of North Africa practiced many religions including various forms of pagan rituals, Judaism, and Christianity. The first Islamic forces encountered fierce opposition by the various city-states resulting from the departure of the Byzantines. The weakest of them in the southern and southwestern parts of the Berber territory were the first to fall to the Islamic troops under the Egyptian Caliph in a locally initiated attempt of expansion westward. This first attempt in late 7th century (660 A.D.) resulted in a decisive defeat of the Islamic troops. The Berber queen Dihya (or Kahina) led the indigenous resistance to the Muslim conquest of the Maghreb. For five years she ruled a free Berber state from the Aurès Mountains to the oasis of Gadames (695–700 CE) but finally was killed in combat near a well that still bears her name, Bir al Kahina in Aures.
In 750 the caliphs centralized their command in Damascus and a coalition of Islamic forces from Medina, Damascus, Baghdad and Egypt returned in a second attempt following successive defeats in Greece. The Islamic forces in a coalition resumed their conquest of the Mediterranean Sea from the south, through North Africa. A more diplomatic second attempt resulted in a successful alliance with the mainly desert-based Mauretanian tribes (Morocco and west of modern Algeria) then Numidia. The new Muslim northwest African tribes in turn became ambassadors of the Muslim Caliphs, and brokers on their behalf in an attempt to assemble a coalition of forces to engage their common enemy Rome. The new approach was better received by the Numidian tribes of the highlands and were successfully recruited for a joint military venture into Europe and ultimately to Rome and around the Mediterranean Sea. A Moorish chief, Tariq ibn Ziyad, headed these stronger forces under the green flag of Islam and embarked for Europe, taking over most of the Iberian Peninsula. It is then that North Africa west of Egypt was referred to as "al-Maghreb" or the "West" by the peoples of the Middle East.
In 670, the Islamic coalition under the command of Uqba ibn Nafi established its camp on the Tunis peninsula and founded the city of Kairouan, about 160 kilometers south of present-day Tunis. The Muslims used the city as a base for further operations against Numidians in the West and along the highlands of modern Algeria. Successive and repeated attacks on the villages of the lower Numidian agricultural valleys by Abu al-Muhajir Dinar, Uqba's successor, forced the uncoordinated Numidian tribes to eventually work out a modus vivendi through Kusaila, a converted Numidian chief on behalf of an extensive confederation of Christian Berbers. Kusaila, who had been based in Tlemcen, converted to Islam and relocated his headquarters to Takirwan, near Kairouan.
The tolerance of Islamic preachers among the Berbers did not guarantee their support for the Umayyad Dynasty—which held control over most of the Islamic Caliphate. Their ruling proxies alienated the Berbers by taxing them heavily; treating converts as second-class citizens; and enslaving the southern and weaker nomadic tribes. As a result, widespread opposition took the form of open revolt in 739-40 under the banner of Kharijite Islam. The Kharijites had been fighting Umayyad rule in the East, and many Berbers were attracted by the sect's egalitarian precepts. The issue at hand is the same Numidians had fought against with the Romans (State Religion) whereby the control of the faith as an inherited right of those in control of the state. The new sect known as Kharijism was born on the premise that any suitable Muslim could be elected caliph without regard to race, station, or descent from the Prophet Muhammad.
After the revolt, Kharijites established a number of tribal kingdoms in the North African highlands. Their safety was purchased with taxation without representation. A set of Islamic representatives and tax collectors were established as attaches, and known as the Marabouts from the Arabic word "mourabitoun" or attaches whose role was restricted to that of a relay between local tribal council of elders of the tribes (Aarch) and the central authority in Tunis. They had neither mosques nor authority. Their houses served as their quarters and were commonly constructed with a dome above whose Arabic term is qoba and Berber one ta qobe-tt (little dome). Other regions and tribes, however, like Sijilmasa and Tilimsan—which straddled the principal trade routes—proved more viable and prospered. In 750, the Abbasids, who succeeded the Umayyads as the rulers of the Caliphate, moved the caliphate capital to Baghdad and reestablished Islamic authority in Ifriqiya, appointing Ibrahim ibn al-Aghlab as governor of Kairouan. Although nominally serving at the caliph's pleasure, al-Aghlab and his successors, the Aghlabids, ruled independently until 909, presiding over a court that became a center for learning and culture.
To the west of Aghlabid lands, Abd ar-Rahman ibn-Rustam ruled most of the central-west Maghreb from Tahert, southwest of Algiers. The rulers of the Rustamid imamate, which lasted from 761 to 909, each an Ibadi Kharijite imam, were elected by leading citizens. The imams gained a reputation for honesty, piety, and justice. The court at Tahert was noted for its support of scholarship in mathematics, astronomy, and astrology, as well as theology and law. The Rustamid imams, however, failed, by choice or by neglect, to organize a reliable standing army. This major factor, accompanied by the dynasty's eventual collapse into decadence, opened the way for Tahert's demise under the assault of the Fatimids.
The Muslims who entered Iberia in 711 were mainly Berbers, and were led by a Berber, Tariq ibn Ziyad, though under the suzerainty of the Arab Caliph of Damascus Abd al-Malik and his North African Viceroy, Musa ibn Nusayr. A second mixed army of Arabs and Berbers came in 712 under Ibn Nusayr himself. It is claimed they formed approximately 66% of the Islamic population in Iberia; supposedly they helped the Umayyad caliph Abd ar-Rahman I in Al-Andalus, because his mother was a Berber.
During the Umayyad conquest of Iberia, Berbers formed their own military units based on tribal allegiances, with little contact with the Arabs. Uthman ibn Naissa, a Berber commander stationed in Cerdanya (eastern Pyrenees), signed an alliance with Odo the Great, duke over Vasconia and Aquitaine, detached himself from central Cordovan rule and shortly established a realm, but was suppressed in 731 by Abdul Rahman Al Ghafiqi.
At this point, Berbers were superficially Islamized and hung onto their traditions with varying degrees of religious assimilation to Islam. Berbers stationed in Galicia who gave up their Andalusian outposts to join the Berber Revolt (740-742) are reported to have converted to Christianity. Accounts of their siege of Mérida make it clear that they were not Muslims at the time. During the Taifa era, the petty kings came from a variety of ethnic groups; some—for instance the Zirid kings of Granada—were of Berber origin. The Taifa period ended when the Almoravid dynasty took over Al-Andalus; they were succeeded by the Almohad dynasty from Morocco, during which time al-Andalus flourished.
In the power hierarchy, Berbers were situated between the Arabic aristocracy and the Muladi populace. Ethnic rivalries were one of the factors of Andalusi politics.
After the fall of the Caliphate, the taifa kingdoms of Toledo, Badajoz, Málaga and Granada had Berber rulers.