Islam in the Ottoman Empire
Islam was the official religion of the Ottoman Empire. The highest position in Islam, "caliphate", was claimed by the sultan, after the defeat of the Mamluks which was established as Ottoman Caliphate. The Sultan was to be a devout Muslim and was given the literal authority of the Caliph. Additionally, Sunni clerics had tremendous influence over government and their authority was central to the regulation of the economy. Despite all this, the Sultan also had a right to decree, enforcing a code called Kanun (law) in Turkish. Additionally, there was a supreme clerical position called the Sheykhulislam ("Sheykh of Islam" in Arabic). Minorities, particularly Christians and Jews but also some others, were mandated to pay the jizya, the poll tax as mandated by traditional Islam.
Secularism in Turkey
Sultan Selim III founded the first secular military schools by establishing the new military unit, Nizam-ı Cedid, as early as 1792. However the last century (19th century) of the Ottoman Empire had many far reaching reforms. These reforms peaked with the Tanzimat which was the initial reform era of the Ottoman Empire. After the Tanzimat, rules, such as those relating to the equalized status of non-Muslim citizens, the establishment of a parliament, the abandonment of medieval punishments for apostasy, as well as the codification of the constitution of the empire and the rights of Ottoman subjects were established. The First World War brought about the fall of the Ottoman Empire and the subsequent partitioning of the Ottoman Empire by the victorious Allies. Therefore, the Republic of Turkey was actually a nation-state built as a result of an empire lost.