The Istanbul court that heard İmamoğlu’s case – at the eleventh hour before he was due to be automatically released – has decided to uphold his arrest and detain him pending trial.
This applies to the first set of charges against him: those containing allegations of fraud and corruption. It means the suspended mayor of Istanbul will remain in prison for the foreseeable future.
On the second set of charges – relating to terrorism – he has been released pending further enquiries, even though there are “strong suspicions”.
In highly unusual language for a judicial document, the court decision points out he is already being held for the corruption charges.
Unusual, because it is common legal practice for cases to be treated in isolation: it is highly irregular to declare a suspect is not being detained on one set of charges on the basis he is already being held on another set of charges.
So: what happens next?
Most immediately, İmamoğlu will become CHP candidate for president. Party members will vote on Sunday, the result declared and the party will formalise the decision later in the week.
There is, of course, no election imminent.
Next, there is the question of the mayoralty. Can it be taken away from İmamoğlu permanently?
Yes: the notorious kayyım process – where a mayor is removed and replaced by the government – remains an option for the interior minister. He has chosen not to use it right now.

The justice minister says this is an independent judicial process and any suggestion of political influence is plainly wrong.

The opposition, and countless observers documenting an increasingly politicised judiciary in Turkey, tell a different story.
It’s clear that a significant section of Turkish society is outraged at what’s going on. They aren’t all CHP supporters.
What is not yet clear is how deep the anger extends. How many religious conservatives, say, or Turkish nationalists think the same? It is too early to say.
Also, note posts like this by a senior pro-Kurdish MP implying Ankara mayor Mansur Yavaş, who has Turkish nationalist roots, is a fascist.

The row is about his view of a recent Kurdish rally. It will be tough to keep an opposition alliance together.
The opposition says all this boils down to Erdoğan not wanting to face İmamoğlu in an election. It’s not yet clear how many voters, and crucially what type of voters, agree with that.
The CHP’s challenge is to maintain momentum and channel public anger – and that won’t be easy.