Islam is the majority and state religion in Algeria. The vast majority of citizens are Sunni Muslims belonging to Maliki school of jurisprudence, with a minority of Ibadi Islam, most of whom live in the M'zab Valley region. Islam provides the society with its central social and cultural identity and gives most individuals their basic ethical and attitudinal orientation. Orthodox observance of the faith is much less widespread and steadfast than is identification with Islam. There are also Sufi philosophies which arose as a reaction to theoretical perspectives of some scholars. History Arrival of Islam Islam was first brought to Algeria by the Umayyad dynasty following the invasion of Uqba ibn Nafi, in a drawn-out process of conquest and conversion stretching from 670 to 711. The native Berbers were rapidly converted in large numbers, although some Christian and probably pagan communities would remain at least until Almoravid times. However, as in the Middle East itself, they sought to combine their new Islam with resistance to the Caliphate's foreign rule - a niche which the Kharijite and Shiite "heresies" filled perfectly. By the late 8th century, most of Algeria was ruled by the Rustamids, who professed the strictly puritanical but politically moderate Ibadhi sect and saw the Caliphs as immoral usurpers. They were destroyed by the Shia Fatimids in 909, but their doctrine was re-established further south by refugees whose descendants would ultimately found the towns of the M'zab valley in the Algerian Sahara, where Ibadhism still dominates. Though it convinced the Kutama, the Fatimids' Ismaili doctrine remained unpopular in most of North Africa, and the Fatimids themselves abandoned Algeria for Egypt as soon as they could, leaving North Africa to a dynasty only nominally subject to them, the Zirids. With the political threat of the Abbasid Caliphate gone, these soon reverted to Sunni Islam - specifically, the Maliki branch, whose popularity had spread widely in the Maghreb. The Fatimids took their revenge by sending the Bedouin Banu Hilal to wreak havoc on the region, but were incapable of controlling it; Shiism rapidly dwindled, and became virtually non-existent in the area. The Almohads were zealously orthodox, and under their rule Algeria gradually acquired its notable religious homogeneity. Sunni Islam and the Maliki madhhab became virtually universal, apart from the Ibadhis of the M'zab and small Jewish communities. Islam took longer to spread to the far south of Algeria, whose history is