After voiding the initial results of the election in Istanbul, a new vote, and a referendum on Erdogan's rule, takes place on 23 June

It came as a surprise to many international observers when, on 31 March, President Recep Tayyip Erdogan’s Justice and Development Party (AKP) lost local elections in many of Turkey’s major cities, including Istanbul and Ankara. A city of 16 million people, Istanbul has been the centrepiece of AKP’s financial system and social networks since 1994 – when a young Erdogan became mayor and started his march to power. Few suspected that Erdogan could lose an election there. Yet the vote not only took Istanbul from Turkey’s ruling party but also challenged the notion that Erdogan was invincible and would remain president for life.

Even more surprising was the winner. Despite the government’s near-total control over media coverage and its self-serving use of state resources, a relatively unknown politician from the secularist Republican People’s Party (CHP), Ekrem Imamoglu, defeated Binali Yildirim, an AKP heavyweight and a former prime minister of Turkey – albeit with a lead of less than 1 percent of the vote. Imamoglu patched together the type of rainbow coalition the Turkish opposition has been dreaming of for more than a decade, gathering secularists, liberals, nationalists, Kurds, and even conservatives around the idea of a more liveable city. To Erdogan’s politically divisive rhetoric, he responded with a mantra of social cohesion – and it seemed to work.

But the battle of Istanbul is not yet over – it’s only beginning.

On 6 May, after a full month of lobbying, the AKP persuaded Turkey’s electoral board to void the Istanbul result due to alleged irregularities – once again proving wrong those who thought Turkey still had independent institutions beyond Erdogan’s reach. As Turkey has held uncontested multi-party elections since 1950 (despite bouts of authoritarianism in that time), a cross-section of Turkish society – from artists and singers to former AKP leaders such as Ahmet Davutoglu and Abdullah Gül – saw the decision to annul the vote as a travesty of justice.

Whatever happens in the election, Turkey has entered a new period

The new election, scheduled for 23 June, is likely to turn into another referendum on Erdogan’s rule. Because his power grab has offended so many voters, pollsters predict that the underdog, the 48-year-old Imamoglu, is starting the new electoral race a few points higher than where he left off. The CHP’s strategy will be to sustain the delicate balance between secularists, conservative dissidents, and more than one million Kurdish voters (comprising roughly 11-12 percent of the voting public) who are upset about Erdogan’s alliance with the hard-line Nationalist Movement Party and his threats to eradicate Syrian Kurdish administrations on Turkey’s borders.

Throughout the last campaign, Imamoglu set himself apart from Erdogan’s divisive rhetoric on internal and external enemies of the state through what CHP officials call a strategy of “radical love”. He also reversed long-held nihilism in the Turkish public: the sense that Erdogan and the AKP would win no matter what. “Hope is here”, Imamoglu said at a pep rally on the night of the election board’s annulment decision, “everything will be all right” – a phrase that instantly become a slogan for the opposition.

There is a curious discrepancy between Turkish and foreign analyses of elections in Turkey. Most international analysts view Erdogan as an undefeatable figure and assume that he would not let Istanbul slip out of his grasp. But such assumptions have been proven wrong in several previous elections. Far more vulnerable than his strongman image suggests, Erdogan is under pressure due to external challenges from Russia and Syria, and to Turkey’s tense relations with the West. Turkey certainly has an illiberal system and an uneven playing field in elections, which are marked by government pressure on the business community, the media, and opposition figures. But the voting process itself is transparent enough at polling stations. Political parties dispatch representatives to the stations, while vote-counting at each of Istanbul’s 31,000 or so ballot boxes takes place under the gaze of party officials and interested citizens.

The challenge for AKP will be in regaining the conservative Kurdish vote

All this means that Imamoglu has a good chance of winning again if he can keep to the moral high ground and avoid offending the Kurds and disgruntled conservatives he needs to bolster the secularist vote. There is already speculation in Turkey that Erdogan will engage in a foreign military adventure (such as a new incursion into northern Syria or a confrontation with Cyprus over natural gas reserves in the eastern Mediterranean) in the run-up to the election, aiming to consolidate his base. There is also fear that political tension in the country will lead to street demonstrations or the type of chaotic atmosphere that emerged after the June 2015 general election, when Erdogan’s party lost its majority in parliament and pushed for a new vote.

But maybe nothing big will happen before 23 June. Like his rival Imamoglu, Yildirim must strike a delicate balance to create a winning coalition. The challenge for AKP will be in regaining the conservative Kurdish vote (which it lost because of its nationalist policies) and in appealing to AKP dissidents who feel their party is on the wrong path. An even bigger challenge will be in explaining away Turkey’s beleaguered economy, which is in a recession and suffers from high unemployment. The value of the lira has already declined by 17 percent since the beginning of this year; a foreign adventure might push more heavily indebted Turkish companies towards bankruptcy.

Whatever happens in the election, Turkey has entered a new period. Erdogan’s rule is no longer uncontested, while both Davutoglu and Gül plan to spearhead political parties that will challenge his one-man regime. And Imamoglu, who may well become the secular rival of Turkey’s strongman in the next presidential elections, is on the rise. If, on top of that, the Istanbul government changes hands – with the opposition gaining control of the municipality’s $9.5 billion budget and its subsidiary companies – Turkey’s political trajectory could change.

But, then again, Erdogan has long been a pragmatist and a master of flexible coalitions. To reverse his declining fortunes, he could distance himself from his ultranationalist allies, attempt a pivot to Europe, or try to reopen long-delayed talks with imprisoned Kurdish leader Abdullah Ocalan – in the hope that a kinder, gentler image will appeal to some Kurdish voters. The government has already allowed lawyers to visit Ocalan for the first time since 2011, and there are reports that the Turkish security services are talking to the Kurdish-dominated Syrian Democratic Forces in northern Syria.

But, given the popular outrage at the electoral board’s decision, it is unclear whether the government’s timid attempts to draw Kurds away from the opposition or its laser focus on the Istanbul campaign will help the AKP regain its foothold in the city. Six weeks is a long time in Turkish politics – but not long enough to solve the country’s problems.

Read more on: Wider Europe, Turkey, European Power, Cohesion & Governance, National Politics