By Sarah Rainsford
BBC News, Ankara
Turkey's ideological struggle between secularism and Islam has seen huge protests in the capital, Ankara. Turks are well aware that if it continues, the military may decide to step in.
For many Turks, secularism is key to Turkey's identity
A couple of weeks ago a new poster appeared outside my local supermarket.
It was a photograph of a smiling Abdullah Gul with a message underneath - "Congratulations!"
That now looks more than a little premature.
Mr Gul's nomination for president sparked such a strong reaction here it is now highly unlikely the foreign minister will ever take up residence in the president's Pink Palace.
But these are uncertain times in Turkish politics, so I would not bet on anything.
Protests and demonstrations
The first fevered speculation here was over whether or not the prime minister himself would run for the presidency. He kept a stony silence for weeks, while the Turkish media chattered about almost nothing else.
Recep Tayyip Erdogan used to belong to an openly pro-Islamic party and although he broke away from those roots to found the governing AK Party five years ago, the idea of a President Erdogan sent many Turks into a state of panic.
Recep Tayyip Erdogan belonged to an openly pro-Islamic party
Hundreds of thousands protested in Ankara, gathering around the monumental mausoleum of Ataturk, the general who made Turkey a modern, secular Republic.
Amid the flood of Turkish flags I saw pensioners up on their balconies waving their support - one man still in his pyjamas, another with a window wide open, and a crackly recording of the national anthem on a loop. The demonstrators down below cheered and clapped as they marched past.
They told me they had come out onto the street to defend the secular republic. Women said they were there to protect their freedoms, above all the right never to wear the Islamic headscarf.
It was an impressive show of force. But it was only one side of the argument, and of Turkey.
Buzz of excitement
In the steep streets and smoke-filled coffee houses of Kasimpasa I felt a very different kind of buzz: of excitement.
2 May: Ruling party requests early elections
16 May: President Ahmet Necdet Sezer's term ends
24 June: Requested dates for early polls
4 November: Scheduled date for polls
The Engin family welcomed me into their cramped top floor flat, in the poor Istanbul suburb where Recep Tayyip Erdogan grew up. Inside they were glued to the television news, looking forward to seeing someone who represents them in power at last.
One of their hopes was to see Turkey's first ever First Lady in the Islamic headscarf, a hot issue for many families here in a country that is more conservative - by and large - than its capital.
"Ataturk's own mother covered her head," Hayri Engin told me, fuming at the protests against Mr Erdogan. "Of course it does not mean secularism is in danger."
Kebire Engin wears a headscarf, but her two daughters do not. They are still at school, where it is forbidden. She hopes an AK Party president would mean those rules could be relaxed.
"People should be able to study in a headscarf or in a mini-skirt. It should be their choice," she told me. "It is what is in your heart that matters."
Families like the Engins helped the AK Party come to power five years ago. So rather than abandon them, Prime Minister Erdogan decided to nominate Abdullah Gul to run for president.
Mr Gul's headscarf-wearing wife is a source of concern for some critics
It was a compromise gesture, made under pressure, but it was also an act of deliberate defiance, choosing another man whose wife wears the headscarf.
Turkey's secularists were furious. And so was the military.
The night Mr Gul failed to get elected in the first vote in parliament, I flew home to Istanbul from Ankara.
As I landed at midnight, I heard that the army general staff had issued a statement claiming this presidential election was a threat to the secular regime in Turkey. The military declared itself ready to intervene - if required - to defend that.
My Turkish colleague's phone rang continually with calls from friends horrified by the implications.
"I told you there would be another coup here," one journalist reminded me, when I phoned him. "The generals are saying 'beware, be afraid'. It is an open threat to the government. The military has had enough."
Another told me later he did not sleep at all that night.
"I think everyone my age thought the same: there is a coup coming," Dogan Tilic said.
When the military took over in Turkey in 1980, he was jailed along with thousands of others. As a student activist, he says he was tortured for over a month.
"That statement from the military means it can all happen again", he said. "It is hard to believe we are talking about yet another coup."
Need for compromise
The military seems to have stepped back from the brink for now.
The presidential vote seems likely to be put on hold and Turkey will instead first elect a new parliament.
Like so much in recent weeks, the end result is still anyone's guess. But when it is time to nominate a candidate for president again, most Turks seem to believe both sides will see the urgent need for compromise.
With that in mind, I looked for that poster of Abdullah Gul again this week. But it is gone. There is an advert for apple juice up there now instead.
From Our Own Correspondent was broadcast on Saturday, 5 May, 2007 at 1100 GMT on BBC Radio 4. Please check the programme schedules for World Service transmission times.