Islam in Tunisia

Islam is the official state religion in Tunisia. According to CIA, 99.1% of its adherents are Sunni Muslims. The constitution of Tunisia states that the country's “religion is Islam”, the government is the “guardian of religion”, and requires that the president be Muslim. The predominant madhhab in the country is the Maliki school.
Overview.
Majority Muslims in Tunisia nominally belonging to the Sunni Malikite madhhab, but a small number of Ibadhi Muslims (Kharijites) still exist among the Berber-speakers of Jerba Island. There is no reliable data on the number of practicing Muslims. There is a Sufi Muslim community, but no statistics regarding their size, as they are considered Sunnis. Reliable sources report that many Sufis left the country shortly after independence when their religious buildings and land reverted to the Government. Although the Sufi community is small, its tradition of mysticism permeates the practice of Islam throughout the country. During annual Ramadan festivals, Sufis provide public cultural entertainment by performing religious dances.
Government and Islam.
The January 2014 Constitution states the country's “religion is Islam.” It designates the government as the “guardian of religion” and requires that the president be Muslim. The constitution guarantees freedom of belief, conscience, and exercise of religious practices, and the neutrality of mosques and houses of worship from partisan exploitation. It stipulates the state's commitment to disseminate the values of moderation and tolerance, protect holy sites, and prevent "takfir" (Muslim accusations of apostasy against other Muslims). The constitution admits the possibility of restrictions on religious freedom, giving general reasons for this as protecting the rights of third parties, national defense, and public security, morality, and health.
The government controls and subsidizes mosques and pays the salaries of prayer leaders. The President appoints the Grand Mufti of the Republic.
Four religious holidays are included among the national holidays in Tunisia: Eid al-Adha, Eid al-Fitr, Muharram, and Mawlid.
Islamic religious education is mandatory in public schools, but the religious curriculum for secondary school students also includes the history of Judaism and Christianity from the Islamic perspective and sources. The Zeitouna Koranic School is part of the Government's national university system.
Generally, Shari'a-based interpretation of civil law is applied only in some family cases. Some families avoid the effects of Shari'a on inheritance by executing sales contracts between parents and children to ensure that sons and daughters receive equal shares of property.
According to the US State Department's International Religious Freedom Report, there have been some reports as of 2004 that the married interfaith couples to register the birth of their children and receive birth certificates if the mother was Christian and the father was Muslim and the parents tried to give their children non-Muslim names.
History.
The area that is now Tunisia came under the rule of Islam during the Umayyad Caliphate, (661–750/A.H.).
The Umayyads founded the first Islamic city in North Africa, Kairouan where in 670 AD that the Mosque of Uqba, or the Great Mosque of Kairouan, was constructed;. This mosque is the oldest and most prestigious sanctuary in the Muslim West with the oldest standing minaret in the world; it is also considered a masterpiece of Islamic art and architecture. Zitouna mosque-university, was created around 703 AD, and became the center of Tunisia's Islamic scholarship and preaching.
The Muslim Arab governors of Tunis founded the Aghlabid Dynasty, which ruled Tunisia, Tripolitania and eastern Algeria from 800 to 909. Its capital Kairuan became the most important centre of learning in the Maghreb, most notably in the field of Theology and Law.
1800–2011.
Tunisia was influenced more heavily by Europe during the colonial era (it was a French protectorate and in 1945 had 144,000 colonialists living in it) and is considered the most westernized of Muslim North African states. Its first president, Habib Bourguiba, was committed to secularism,
and dismantled University of Ez-Zitouna, replacing it with a faculty of Shari`a and Theology attached to the Tunis University in 1958. 
A Personal Status Code made law in 1956 prohibited polygamy, raised the age of marriage for girls to 17 years of age, made it easier for women to get a divorce, and banned forced marriages for minor girls. He also named a Grand Mufti of the Republic.
His successor, Zine El Abidine Ben Ali (1987–2011), created a Higher Islamic Council. He required that imams of mosques be appointed by the Ministry of Religious Affairs. The ministry often appointed members of the ruling Democratic Constitutional Rally party, which also controlled the content of prayer services. A law passed in 1988 forbid all activities and meetings in mosques by people other than those appointed by the state.
In 2004, the US State Department reported that people were sometimes interrogated just for associating or being seen in the street with practising Muslims. The government allowed the construction of mosques provided they were built in accordance with national urban planning regulations, but upon completion, they became the property of the Government. There were also frequent reports that police sometimes harassed or detained men with beards whom the Government suspected because of their "Islamic" appearance. 
After the revolution.
The fall of the Ben Ali regime has loosened religion repression and brought more religious conservatism, and sometimes more extremism. The 1988 law banning non-state approved activities and meetings at mosques was discontinued allowing much longer hours of operation.
For some months after Ben Ali's overthrow in the 2010–2011 Tunisian Revolution, many of the imams his regime had appointed were replaced, "often by violent Islamists", accused of having collaborated with the old regime. By October 2011, the Ministry of Religious Affairs announced that it had lost control of about 400 mosques. (Another indication of the ascendance of conservative Islam was the large plurality the Islamist Ennahda party won in the 2011 Constituent Assembly election.)
In March 2013, the minister of religious affairs at the time, Nourredine Khademi, called upon Tunisians to fight jihad in Syria. As of early 2015 about 3,000 Tunisians are believed to have gone to fight in Syria. Calls came for legalization of polygamy, from Commission for the Promotion of Virtue and Prevention of Vice A new mufti appointed in 2013, (Hamda Saïd) was known to have supported polygamous marriage.
In August 2013, the Tunisian government declared Ansar al-Shari`a an illegal terrorist organization following its alleged involvement in the political assassinations of secularist politicians Chokri Belaid and Mohamed Brahmi in 2013.
Following an Islamist attack on July 16, 2014 killing 12 army soldiers, the prime minister's office created a “crisis unit” to coordinate efforts to combat terrorism. Shortly thereafter, the ministry closed two religious radio stations and one television channel it accused of spreading hate speech and advocating violence, and 157 associations—mostly Islamic—because of alleged links with terrorism and incitement to violence. (Human Rights Watch called these suspensions disproportionate and arbitrary.) Islamist Attacks on tourists (over 60 civilians, mostly tourists, were killed in 2015 by jihadis), devastating Tunisia's tourist industry.
In December 2014 the Ministry of Religious Affairs announced it had re-asserted state control over all mosques in Tunisia and in cooperation with civil society organizations, trained imams in moderate discourse when delivering sermons. But, at least as of 2014, the content of prayer services is not controlled by government authorities.
In 2017 a handful of men were arrested for eating in public during Ramadan, they were convicted of committing “a provocative act of public indecency” and sentenced to month-long jail sentences. The state in Tunisia has a role as a "guardian of religion" which was used to justify the arrests.
Since 2017, Tunisian Muslim women can legally and officially marry non-Muslim men. 