By Sarah Rainsford
BBC News, Istanbul
Four months ago Abdullah Gul stood for election as the president of Turkey and sparked a political crisis.
One military memorandum, several major street protests and one general election later, he is trying again.
Mr Gul has declared his loyalty to Turkey's secular constitution
It is all strangely familiar territory. But the balance of power here has shifted.
Back in April, Mr Gul was nominated for president by his ruling AK Party. He once belonged to a pro-Islamic party.
The opposition CHP boycotted the vote, declaring Abdullah Gul a danger to Turkey's strict secular system.
That night the country's powerful generals issued a statement warning they would intervene to protect secularism, if required.
Days later, the Constitutional Court annulled the vote on a technicality.
The AKP cried foul and called an early general election to prove it had popular support.
The party won a decisive victory and this month put Abdullah Gul forward for president once again.
"That 46.5% support for the AKP was primarily a vote for economic stability," believes Barcin Yinanc of the Turkish Daily News.
"The result also sent a message that nearly half of Turkish voters disapprove of military intervention in politics and I think the generals have to get that message."
The scale of the AKP victory is also taken as proof that the majority of Turks do not believe claims the party has an Islamist agenda.
Immediately after the landslide election result was announced, Prime Minister Recep Tayyip Erdogan pledged to seek consensus over the presidency to avoid a re-run of the crisis.
There was talk of less controversial candidates, whose roots were not in political Islam.
"I don't think Erdogan wanted Gul to run, but he could not refuse when Gul insisted," says journalist Rusen Cakir.
Abdullah Gul announced his candidacy on 14 August declaring his loyalty to Turkey's secular, democratic constitution.
Mrs Gul has been firm about her right to wear the Islamic head scarf
"I think Gul got to like the idea of being president," says Mr Cakir.
"What happened the first time made him more determined. Then, at the general election rallies, he felt the people on the streets were really behind him."
The make-up of the new parliament must have helped remove any latent concern in the party about insisting on Abdullah Gul for president.
The CHP is still proclaiming the AKP a mortal threat to the republic, and has again announced a boycott of the presidential ballot.
But the nationalist MHP and pro-Kurdish DTP now have seats in parliament and both have pledged to turn up.
Their deputies are unlikely to vote for Abdullah Gul but their presence alone will ensure the minimum 367 turn-out required for the vote to be valid, so avoiding an all-out crisis.
A candidate needs 367 votes to win in the first or second round. With the support of 341 AKP deputies, Abdullah Gul is most likely to be elected in the third round when he only needs 276 votes.
If so, the Presidential Palace would host a First Lady who wears the Islamic headscarf for the first time in Turkish history.
That prospect disturbed many secularists who took to the streets in mass protests against Abdullah Gul in April and May.
The headscarf is banned in all state institutions, seen by some as a subversive symbol of political Islam.
"Some people worry because Hayrunnisa Gul has been quite militant about her right to wear the headscarf," says Barcin Yinanc.
"She tried to take the government to the European Court of Human Rights over the restrictions here, but people will have to get used to her now and hope that just because she covers her head she doesn't have a different mentality."
There are already rumours Mrs Gul has turned to a famous fashion designer, possibly seeking to modernise her look.
Thousands of secularists have marched in protest against Mr Gul
The military is unlikely to be appeased. But the generals - who have forced four governments from power in four decades - are also unlikely to take any direct action yet, despite previous warnings.
"Turkey has too much to lose these days to risk a coup. It's too tied into global markets - and the Turkish people would not support it," believes analyst Sedat Laciner of USAK Strategic Research Organisation.
"The generals will not be happy, but they will play a wait-and-see game. They'll watch carefully and wait for Gul to make a mistake. And in the meantime they'll make life very awkward for him and the AKP."
The opposition CHP has already announced it will boycott all presidential receptions in protest if Abdullah Gul is elected.
The military is also likely to keep relations distant. The first test of that will be Victory Day celebrations on 30 August - traditionally hosted by the generals.
"There will certainly be tension, but there will be no major crisis in the short term," Rusen Cakir believes.
"When a party has almost 47% support, it's really difficult to attack that."