Islam made an entrance in Africa from Asia in the 7th century. Nearly one-third of the total Muslim population in the world can be found in Africa. During the Hijarat, Muslims sought refuge in Ethiopia's territory having crossed Djibouti, Somalia, as well as Eritrea. Most Muslims who reside in the continent observe Sunni Islam. The Islam in Africa is dynamic and complex, and it is constantly redefined by prevailing political, social, and economic conditions. Islam enjoys a dominant presence in the Horn of Africa, much of West Africa, North Africa, and the Swahili Coast. The religion has however been met with resistance and criticisms in some nations of Sub-Saharan Africa.
Mauritania established itself as the Islamic Republic after it gained sovereignty in 1960. The 1985 Constitutional Charter identifies Islam as the state religion and Sharia as the law of the land. Muslim artisans and traders spread Islam to Mauritania's territory, and they were later joined by the founders of Islamic brotherhoods. The brotherhoods, namely Sufism and tariqa, particularly gained influence during French colonial administration. Mauritanian Islam has incorporated some traditional beliefs, and Muslims in the country believe in the existence of several lesser spirits which were changed from Pre-Islamic beliefs to Islamic spirits. 99.9% of the Mauritanian population are Muslims, nearly all of whom are Sunni Muslims adhering to the Maliki Madhhab.
99.8% of Somalis profess the Islamic faith, and they are Sunni Muslims. Islam has been an important part of Somali's history for over 1400 years. Islam in Somali has for generations been dominated by Shafi'i jurisprudence, Ash'ariyah, and Sufism but Salafism has been gaining ground in recent decades. The city of Zeila is home to a 7th-century mosque named Masjid al-Qiblatayn, and it was constructed shortly after the hijra. Islam spread across Somali's territory and facilitated the growth of sultanates and republics that were at the center of trade, religion, and commerce such as Mogadishu, Hobyo, and Merca. Although the 1961 constitution made provisions for freedom of religion, it proclaimed the newly independent Somali as an Islamic state.
99% of Algerians are Muslims, and they observe Sunni Islam and the Maliki School of jurisprudence. There exists a minority of Ibadi who mostly resides in the M'zab Valley region. Islam arrived in Algeria with the Umayyad dynasty in the wake of the invasion of Uqba Ibn Nafi. The indigenous Berbers accepted the religion in huge numbers, but it was not until the 15th century that the Tuareg finally became Muslims. The discrimination of Muslims by French colonial authorities inspired resistance movements and scholars such as Abdelhamid Ben Badis urged the native population to remain steadfast in Islam. Islam provides the Algerian society with its central cultural and social identity.
99% of Morocco's inhabitants observe Islam, and they are Sunni in the Maliki school of thought. The introduction of Islam to Morocco is attributed to the Uqba Ibn Nafi-led Arab invasion in 680. Powerful Islamic dynasties subsequently reigned in the region for centuries. The persecution of minority Muslim sects during Almohad rule made Sunni Islam dominant in the nation. Salafi Islam has been gaining influence, and King Mohammed VI has been trying to curb this growing popularity.
98% of Tunisians adhere to the Islamic faith. The Tunisian Constitution requires that the country's president be Muslim and it appoints the government as the "guardian of religion." The most popular school of thought in Tunisia is the Malaki jurisprudence. All Tunisian public schools teach Islamic religious education, and the religious curriculum for the country's secondary school includes the history of Christianity and Judaism from the Islamic sources and perspective. There exists a small community of indigenous Sufi Muslims.
98% 0f the inhabitants of Comoros are Muslims; most of whom are Sunni adhering the Shafi'i school of thought. Most of the Muslims residing in Comoros are Arab-Swahili although they are communities of Indian descent. Historical records have identified Arab merchants as well as exiled Zayidi Persian princess as the groups of people who introduced Islam to Comoros. Ruling Islamic families popularized the religion over the years. Hundreds of mosques populate the islands in addition to many madrassahs. Nearly all children enroll in Quranic School for a duration of two or three years during which they gain knowledge of Arabic linguistics and the rudiments of Islam.
97% of the residents of Mayotte are Muslims while the rest 3% profess Christianity. Almost all of Mayotte's inhabitants are Comorians who trace their ancestry to groups such as Arabs, Iranians, Malagasy, and Africans. The Comorians have traditionally been adamant to any form of religious change. Mayotte is said to practice a tolerant form of Islam.
The Muslim community in Sudan is estimated to be 97% of its population. Muslims have a dominant presence in all of the regions except the Nuba Mountains region. The Sunni Islam adhered to in Sudan has been profoundly influenced by Sufism. Shia communities live in Khartoum. The major divisions occur between Sufi brotherhoods, especially among Ansar and Khatmia. Only the Darfur region has been spared of the existence of Sufi brotherhoods as found in other parts of Sudan. The Arabs, Nubians, Beja, Fur, and Zaghawa are some of the ethnic Muslim communities in Sudan.
Approximately 96.6% of Libyans follow the Islamic faith and particularly the Sunni branch. Islam took root in Libya’s urban regions in the 7th century, but it was not until the 11th century that invasions by Bedouin tribes facilitated the conversion of nomads. The Islam observed in North Africa including in Libya feature native Berber beliefs. Orthodox Islam was particularly favored by Muammar al-Gaddafi, under whose leadership Sharia law was reinstated, the highly symbolic purification of mosques was carried out, the modest dressing was embraced, and activities considered immodest were banned. There exists a small minority of Shias and Ahmadis among Pakistani immigrants.
94% of Senegal's population are Muslims, and they mainly observe Sunni Islam of the Maliki school of thought featuring Sufi influences. Islam has had followers in Senegal as far back as the 11th century. Sufi brotherhoods gained prominence during French occupation as the population sought religious authority in place of colonial administration. The major Sufi orders are the Mourides, Tijaniyyah, Pan-Islamic Qadiriyyah, and Layene. 95% of Senegal’s Muslims are participants of a Sufi brotherhood and the brotherhoods establish mosques although people are free to go to their preferred mosque.