When I first moved to Istanbul in early 2012, Recep Tayyip Erdogan was a hero, perhaps deservedly. Travelling across the country, I heard his praises everywhere. “Erdogan did this,” said a local in Cappadocia, pointing to the smooth, wide roads. “Erdogan built this,” said another, in the southern town of Pamukkale, gesturing to the brand-new hospital.

In town after town, people told me how Erdogan’s Justice and Development Party (AKP) — fresh from a massive victory in the 2011 elections — had hauled Turkey out of poverty. The economy was booming, Istanbul was a glittering carpet of skyscrapers and malls.

Even Erdogan’s religious conservatism, especially lifting the ban on headscarves in public offices, appealed to many. “Turkey is an Islamic country, and we need to be given room to be Muslim,” a headscarved Istanbul mother said.

This week, in a shocking election, the results of which no one predicted, the AKP lost its majority, taking only 40 per cent of the vote. The Kurdish HDP party entered parliament for the first time, taking 13 per cent of the vote.

What went wrong?

In a nutshell, Erdogan went too far. He underestimated the Turkish voter, and most importantly the Turkish minority voter: liberals, women, and Kurds. He gambled on polarising the electorate, calling dissenters “terrorists and infidels”. He lost.

It began in 2012, when the government became alarmingly domineering. Erdogan introduced curbs on alcohol. Then came curbs on abortion. Erdogan began to air his opinions on everything, from Turkish society to the Istanbul skyline, calling on women to have at least five children.

“The AKP is trying to control women’s bodies by using religion to take away our rights, and undoing everything Ataturk did,” Ayse Cavdar, a journalist and researcher, told me.

In May 2013, the government announced plans to take over Gezi Park, a beloved green oasis in downtown Istanbul’s concrete jungle, and put up a shopping mall. Even the most staid and apolitical went to protest in Taksim Square. They were brutally teargassed and assaulted with water cannons. Some 11 people were killed, thousands injured. One of the dead was 15-year-old Berkan Elvin, who had stepped out to buy bread. Erdogan called the protesters “looters”, and Berkan a “terrorist pawn”.

Ever since then, Istanbul and other Turkish cities have been restive. I remember making a brief and terrifying foray for milk on May Day last year, and getting a faceful of tear gas.In December 2013, the government was hit by allegations of corruption. Tapes released on the internet appeared to reveal a conversation in which Erdogan asked his son to dispose of millions in cash. But the president (and former prime minister), undaunted, continued his domineering ways. In November 2014, he told women at a forum for justice that they were not equal to men. “He wants to control our entire lives,” said an angry Zeynep Karali, a secretary, even though she came from a family of diehard AKP supporters. Meanwhile, Erdogan changed the system of government to a presidential one, to give himself even more powers.

Total clampdown

Earlier this year, the government clamped down on the press, arresting many journalists. Then it introduced a brutal and much reviled Bill against public protests which barred protestors from covering their faces when being teargassed and gave even more powers to the police. Then, in what was the last straw, Erdogan built himself a 1000-room, $615-million palace in Ankara. The economy worsened and the AKP’s ability to create jobs seemed to recede.

Just before the elections, hundreds of Istanbullus gathered to remember the centenary of the Armenian genocide. This time, I sensed a new desire amongst the protesters, most of whom were not of Armenian descent, to let stifled voices speak out.

It’s hard not to view this election as a loud rejection of Erdogan’s policies. He has been dismissive of environmental concerns, obscuring Istanbul’s skyline with malls and skyscrapers. In response, the Kurdish HDP party has been promoting its environmental credentials. He has been steadily contemptuous of women. A record number of women entered parliament. He called HDP leader Selahattin Demirtas “a pretty boy”, but voters still responded to Demirtas’ message of a gentler, if more uncertain government.

Istanbul is buzzing with rumours of snap elections in a few months, and the AKP is still the largest party. But one thing is clear: they will need to change their ways. Tweeted the conservative commentator and writer Mustafa Akyol, a longtime AKP supporter: “There is only one code word for the setback of the AKP: arrogance.”

The writer is a freelance journalist based in Bengaluru and Istanbul

comment COMMENT NOW