Sweeping away the decayed Ottoman caliphate, Ataturk chose as his guiding principles many imports from Western nations: dictatorship, modern dress, a Latin alphabet and legal, criminal and commercial codes translated directly from those of European countries.
Ataturk quickly identified the clerical class as a principal source of domestic opposition. He banned religious courts, and in 1928 he launched Turkey as the first secular state in the Muslim world.
He even made the muezzins translate into Turkish the Arabic call to prayer, which is chanted five times a day from minarets all over the Islamic world.
The country's ruling ideology was Kemalism - a complex mixture of secularism, single-party statism, self-sufficiency, Turkish nationalism and Westernisation, without being dependent on anyone.
Ataturk died in 1938, and in 1950 a right-wing government came to power and began to dilute the pure spirit of Kemalism, restoring the Arabic call to prayer and, keen to shore up its rural vote, redressing the balance in favour of the country's Islamic roots.
Secularism turned out to be a double-edged sword. Religious control was carried over from the Ottomans.
Instead of being led by a Sheikoleslam chosen by the sultan, the republican clergy is organised under a presidentially appointed director of religious affairs.
Church and state are far from separate. Mosques may often be built by public subscription, but more than 60,000 such buildings are maintained by the state, and the clergy is financially supported by the government, as is a whole infrastructure of religious publishing.
Islamists first entered Turkish government as small but key coalition partners in the 1970s, often taking 'soft' ministries, such as education and the interior, and gradually achieving the Islamic tendency that Aziz Nesin often complains of today.
While the Turkish private sector and Western city folk are resolutely European in style, some government departments - including the police - and some schools are already influenced by a new generation of bureaucrats and teachers who, although few, believe in the reimposition of full Islamic law.