The past week will go down as one of the most exciting in Turkey's history. It began on Tuesday with the ruling AK party's nomination of foreign minister Abdullah Gül as its presidential candidate. It ended yesterday with a high court challenge and a stark military warning.
Here is what has happened in the last 48 hours: there were 361 votes cast in Friday's first round. Abdullah Gül received 357 votes, ten short of what he needed to win. Of the remaining four ballots, three were spoilt and one was blank.
The main opposition CHP took the election to the Constitutional Court, claiming the legal requirement for attendance (367 MPs, they say) was not met. AK says the 367 figure is irrelevant, but also slyly claims the attendance was 368, thanks to CHP members coming in to observe the ballot.
The court has promised a judgement before Wednesday's second round. If the CHP claim is upheld, the first round will be annulled and all further rounds cancelled. The likely route from there is an immediate general election. If, however, the court dismisses the CHP claim, Wednesday's second round will go ahead as planned, and Mr Gül will be elected president by round three, when the vote requirement is dropped to a simple majority of 276.
Hours after the CHP's case was handed to the court, the military weighed in. In a statement released at midnight, timed so that it would miss the evening news bulletins but appear on the morning front pages, the army said that the presidential election was turning into a discussion of the secular system. It went on: "The Turkish Armed Forces is watching the situation with concern. It must not be forgetten that the armed forces is party to these discussions and is the absolute guardian of secularism."
The government's response to the statement was just as blunt and angry: "We cannot accept an anti-government declaration from the General Staff, an office answerable to the prime minister. This midnight statement can only be interpreted as an attempt to influence the judicial process." The European Union responded too, saying that the presidential election was a test case for the army to respect democracy.
Today, tens of thousands of people have gathered in Istanbul for a secularist rally. It follows a similar demonstration in Ankara two weeks ago, when around 300,000 people attended to protest Recep Tayyip Erdoğan's potential candidacy.
Three important points must be made about this weekend's developments. Firstly, this is indeed the first presidential election in Turkey's history to be taken to court, but that is nothing to be ashamed of. Rather, it demonstrates that Turkey is a democratic state operating under the rule of law. Politicians frequently bicker; the fact that the judges have been called in to settle this dispute shows that power in Turkey does operate horizontally as well as vertically.
Second, there might be more to the army's position than meets the eye. It is true that this is the bluntest statement since Yaşar Büyükanıt became Chief of the General Staff, but it could have been a preemptive measure. Today's secularist rally is sure to feature demonstrators calling for the army to intervene. Perhaps the statement was designed to placate those demonstrators.
Where the army is most certainly wrong is in its resolute insistence that the secular system can never be up for discussion. To discuss does not mean to dismantle. In fact, discussion could strengthen the secular system. A public debate on the role of religion in the state can help remind Turks why secularism is important without having to resort to Kemalist dogma. More on that in a later post.
Third - this is not a crisis. It is a serious debate concerning issues far more fundamental than a voting technicality, but everyone is playing calmly and by the book. Talk of a direct military intervention is, at this stage, nothing but rumour.
It is difficult to predict what the Constitutional Court's decision - expected on Tuesday - will be. My personal opinion is that the CHP challenge is baseless, because the constitution contains nothing to suggest the attendance for a presidential vote should be any different from any other session. My feeling is that the case should be dismissed, but I cannot wholeheartedly say that I expect the court to rule against the CHP. As BadTyrpist wrote in a comment on Friday, the text of any pro-CHP ruling will have to be read very closely.