Ten years ago, even a tourist could foresee the drama that has been unfolding in Turkey, where the staunchly conservative government of Recep Tayyip Erdogan faces demonstrations against autocracy and religious fundamentalism. The cultural gap between these “two Turkeys” was already visible in the streets of Istanbul, starkly illustrated by the attire of its women.

Editorial cartoon

With their revealing, sexy outfits, many young women looked like they had been transplanted from Montreal on a hot summer day. An arguably equal number of young women were hidden under Islam’s dark garments, their faces half-masked by veils.

Mind you, these were not the hijabs worn by religious women in Cairo, who wrap their hair in sophisticated knotted scarves that highlight their beautifully made-up eyes and wear elbow-long sleeves but extra-tight jeans. On the contrary, in the fundamentalist parts of Istanbul, the female body was entirely erased from public view. There wasn’t a hint of the subtle twist of coquetterie that one could see in Cairo or even Iran, where “liberated” women artistically push back their veils to reveal the front part of their hair, like Madonnas in Italian Renaissance paintings.

Over the past couple of decades, a large influx of rural families have settled in Istanbul in search of better jobs. They have become a reminder that beyond glitzy Istanbul – a city divided between Europe and Asia, that in many districts looks like any Western capital despite the mosques – lies a vast, conservative country whose majority is now wholeheartedly behind a government that has gradually proceeded to destroy the heritage of Kemal Ataturk, the founder of modern secular Turkey.

For Ataturk, the downfall of the Ottoman Empire, after the First World War, provided a window of opportunity to shape the country on the model of the secular Republic of France. Gender equality was proclaimed and traditional head coverings forbidden for men as well as women. During a stay in Istanbul, I was surprised by the vehement reaction of the hotel owner when I asked whether the post office was open on Friday, the Muslim holy day. “Of course it is!” he proudly said. “We are a secular country, just like France.”

For decades, the powerful Turkish army was the guardian of Ataturk’s revolution. But as the military’s power waned, the forces of tradition slowly came back. An American who had taught English years before in Anatolia was flabbergasted to see so many veiled women in Istanbul. “Even in my remote Anatolian town,” she told me, “no girl would show up at school with a veil.”

The changes were incremental. Mr. Erdogan’s government lifted the 90-year-old ban on head scarves in parliament. Then it forced all public schools to offer instruction in Arabic, the sacred language of the Koran. It started to campaign against abortion and urged women to have at least three children. Then it outlawed the sale of alcohol late at night, even in touristic areas. Meantime, dissident writers were sent to jail, and Mr. Erdogan is now pushing for a presidential regime to replace the parliamentary system so that he can run again when his prime ministerial term expires.

Until this year, the two cultures – the one inspired by the West and the one embedded in the rural Muslim society – coexisted relatively peacefully in cosmopolitan Istanbul. But they were bound to collide.