An election that started with both leading candidates claiming victory ended up with neither of them getting it.
Although the votes are still being counted, it now seems all but certain Turkey will be heading towards a run-off between Recep Tayyip Erdogan and Kemal Kilicdaroglu.
Neither managed to get past 50% of the vote, so they will have to go again, head-to-head.
The backdrop to the second round will probably be more fractious. Turkey has shown that it is divided profoundly between those who are loyal to Erdogan, and those who would love to see the back of him.
Erdogan knows he was put under threat, he may bristle against his opponents with ever greater vigour. He has already linked Kilicdaroglu with terrorism, on the basis of no evidence, and the rhetoric is likely to become more biting.
Erdogan will now enter the second round as the favourite. His coalition will take a majority in parliament, after elections that happened in parallel with the presidential vote. AK, the party Erdogan founded, will end up with around 100 seats more than the main opposition party, Kilicdaroglu’s CHP.
Momentum counts for a great deal, and it seems Erdogan, the great survivor, has found it at the crucial time. On Saturday, the bookmakers had Kilicdaroglu as a warm favourite to become president. Now, they favour Erdogan.
But there is a crucial extra moving part to this election, and it’s a person. Sinan Ogan is the leader of the nationalist ATA Alliance, who will finish third in the poll with something like 5.3% of the total vote.
His supporters are particularly loyal to him, seeing him as an example of patriotism. So his opinion on who they should vote for in the run-off could be crucial. That chunk of votes could be enough to get either man across the line.
On the face of it, you’d think it would be an obvious call, for Ogan’s brand of nationalism would seem to have a resonance with Erdogan, and with the National Alliance party that supports him.
But, as with everything in Turkish politics, things get more complicated the closer you look.
Read more:
Erdogan seeks to fire up his supporters
The man who wants to end the Erdogan era
Who is the potential kingmaker?
For one thing, Ogan has an awkward history with the National Alliance, having been thrown out, allowed to return after a court case, and then promptly expelled again.
For another, he is a secular politician, while Erdogan is unapologetic in putting religion at the heart of his plans. This, after all, was the man who converted the extraordinary Hagia Sophia back into a mosque, 86 years after Kemal Ataturk, the founder of modern Turkey, had made it into a cultural museum, unaffiliated to any religion.
So what does Ogan think? At 2am, with the election results still coming in, we are told we can meet him. He is already convinced that there will be no overall winner, not least because Kilicdaroglu has already phoned him up to talk about the future. So has one of Erdogan’s closest advisors.
We chat over tea, and he tells me that he will only decide who to back after talks with his voters and the members of his coalition. But I get the sense he is enjoying the sense of playing his cards.
‘Turkey is on the verge of change’
What is clear is that he won’t sell his support cheaply. I ask if his price includes a place in government, and it’s clear that it does.
“We see ourselves as being the insurance in the Turkish government,” he said. “Mr Kilicdaroglu does not have much foreign policy experience, and Mr Erdogan is an individualist.
“Our being in would balance this. That is why, if we agree on this, we would like to be part of the government.
“Turkey is on the verge of change. These leaders are old in age but also old in the way of thinking. They are obsolete. Soon we are expecting a changing of the guard in the political elite, with the younger generation taking over.
“I think there will be another election in two or three years time, and this election has proved that we will be part of the political future of this country.”
The only thing that seems sure is that, by the end of this month, Turkey will have decided upon its president. But in a campaign where the divisions have been so stark, Ogan is the joker in the pack.
The man who lost in the first round might just be the man who decides who wins in the second.