Islam in Egypt is the dominant religion with around an estimated 85% of the population. Almost the entirety of Egypt's Muslims are Sunnis, with a small minority of Shia and Ahmadi Muslims. The latter, however, are not recognized by Egypt. Islam has been recognized as the state religion since 1980.Since there has been no religious census the actual percentage of Muslims is not known: the Christians are estimated to be number between 3% to 20% according to sources cited in articles Religion in Egypt and Christianity in Egypt.
Prior to Napoleon's invasion in 1798, almost all of Egypt's educational, legal, public health, and social welfare issues were in the hands of religious functionaries. Ottoman rule reinforced the public and political roles of the ulama (religious scholars), as Mamluk rule had done before the Ottomans, because Islam was the state religion and because political divisions in the country were based on religious divisions. During the 19th and 20th centuries, successive governments made extensive efforts to limit the role of the ulama in public life and to bring religious institutions under closer state control.
After the Egyptian Revolution of 1952, the government assumed responsibility for appointing officials to mosques and religious schools. The government mandated reform of Al-Azhar University beginning in 1961. These reforms permitted department heads to be drawn from outside the ranks of the traditionally trained orthodox ulama.
In the late 10th century, the Shia Ismaili caliphate of the Fatimids made Egypt their center and Cairo their capital. Egypt flourished and the Fatimids developed an extensive trade network in both the Mediterranean and the Indian Ocean. Their trade and diplomatic ties extended all the way to China and its Song Dynasty, which eventually determined the economic course of Egypt during the High Middle Ages. Many traces of Fatimid architecture exist in Cairo today, the most defining examples include the Al Azhar University and the Al Hakim mosque. The Fatimid palace in Cairo had two parts. It stood in the Khan el-Khalili area at Bin El-Qasryn street.