Given the stakes, the debate was surprisingly cordial. Against a backdrop of images of Istanbul, the two candidates for this Sunday’s rerun of the city’s mayoral election held a three-hour televised debate last Sunday, a rare occurrence in an electoral system more used to bombastic speeches.

On one side was Ekrem Imamoglu, the opposition Republican People’s Party (CHP) candidate who won the March election. On the other, former prime minister Binali Yildirim  for the ruling Justice and Development Party (AKP). Not onstage, and indeed largely absent from campaigning for some days, was Recep Tayyip Erdogan, the president and the driving force behind the whole mayoral rerun.

Yet this election is largely about his future. It could decide whether his time has passed and perhaps even hand a platform to someone who could challenge him for the presidency in four years. This crucial vote, then, is not merely about electing a mayor, but about removing a presidential rival.

Sunday’s rerun is a vital election for Turkey. The decision of Turkey’s Electoral Council to strip Imamoglu of his post over electoral irregularities just two weeks after taking office was widely condemned. Guy Verhofstadt, former prime minister of Belgium and now one of the European Union’s most senior figures, said it demonstrated Turkey was “drifting towards a dictatorship.” There were widespread protests across Istanbul.

If Imamoglu is returned as mayor and the AKP does not try another way to cancel the result, it may soothe some of the international concerns about Turkey’s democracy. Yet the machinery of the state is against him.

The local elections in March were a significant blow to Erdogan and his party. Although their alliance won a majority – only just, at 51% – of the seats, they lost in crucial areas, including the capital Ankara and Turkey’s biggest city, Istanbul. Erdogan is not a man to take losing lightly and after Imamoglu’s narrow victory, the AKP used its considerable clout to raise questions about the vote, culminating in the decision to re-run it.

The decision was divisive even within the AKP; one of the party’s founders and former presidents Abdullah Gul may well leave the party over the issue. But it seems President Erdogan would not let the biggest city go without a fight.

To show just how important the election was, the AKP announced that Erdogan – the national leader, remember – would stage 30 rallies just in Istanbul before the election. But then, in a sign of how unpopular he may have become with swing voters, most of the rallies did not take place. Erdogan has not addressed a rally in the city for nearly two weeks and the vote is only days away.

If the president has decided to step aside, he has also thrust another divisive figure forward. In a fairly transparent attempt to sway Kurdish voters, who make up nearly 20% of the city, the jailed Kurdish militant leader Abdullah Ocalan was allowed to meet with his lawyers last month for the first time in eight years – a decision that could only have come from the very top of Turkish politics. Since then Ocalan has issued two statements – neither of them about the Istanbul election, but taken together they suggest that the door may be open for his return to public life or that Erdogan may be minded to pursue a more conciliatory approach toward the Kurdish minority.

That may be enough to pull back some Kurdish votes. But the election has divided Kurds as much as it has divided other Istanbulites. On Tuesday, another jailed Kurdish politician, Selahattin Demirtas, the former leader of the pro-Kurdish People’s Democratic Party (HDP), threw his backing behind Imamoglu.

Whatever happens on Sunday, the election has already proved enormously divisive. But it also offers a glimpse of what might come after in Turkey’s politics

Whatever happens on Sunday, then, the election has already proved enormously divisive. But it also offers a glimpse of what might come after in Turkey’s politics.

If Yildirim wins, the absence of the president during the latter stages of the campaign – in contrast to his appearance front-and-center during the March elections – will suggest he no longer commands the same appeal beyond his base that he used to. If Imamoglu wins, such a divisive campaign will have boosted him and given the opposition a powerful narrative of an election that was almost stolen but ultimately reclaimed by “the people.”

That is indeed the message Imamoglu’s campaign has been pushing – that Sunday’s election is a test not merely for him but for Turkey’s democracy. He has run it more like a national election campaign, pushing an optimistic vision of the future and visiting mosques in AKP-supporting areas.

That is the sort of message that could rival Erdogan’s at the next presidential election in 2023 – and the mayoralty of Istanbul is precisely the sort of platform to help a politician gain national recognition, which is precisely what it did for Erdogan himself in the 1990s. The four years he spent as mayor of Istanbul were the launch pad for his rise to power, the laboratory where he honed a brand of pragmatic, prudent Islamism that eventually thrust him into the presidency.

No one understands better than Erdogan the power that comes with running Istanbul and he seems determined to deny such a platform to any rival – especially one who could mobilize the considerable resources of the CHP, the main opposition party. Whether he has done enough to stop that happening will become clear on Sunday night.

This article was provided to Asia Times by Syndication Bureau, which holds copyright.