By Roger Hardy
BBC Middle East analyst
In a sense, Turkey is back to square one.
Back in April, the country's Foreign Minister, Abdullah Gul, made a bid for the presidency - sparking a furious response from secularists because of his Islamist background.
Mr Gul is expected to win in the third round of voting on 28 August
Now, four months on, here he is again, trying once more to become Turkey's next head of state.
Among diplomats, Mr Gul is seen as a voice of moderation. Moreover he is the man who has spearheaded the country's efforts to join the European Union.
But secularists - including Turkey's powerful generals - deeply distrust him.
They believe Mr Gul and the ruling Justice and Development (or AK) Party to which he belongs harbour a secret Islamist agenda.
Mr Gul's wife wears a Muslim headscarf - in Turkey a deeply divisive symbol of identity.
But between Mr Gul's first bid for the presidency and his second, something important happened.
If the transition is sustained, its significance will extend beyond the country's borders to the wider Muslim world
AK called an early election and won a landslide victory.
The party believes this gives Mr Gul an unassailable popular mandate.
Secularists, including the opposition Republican People's Party, are incensed that he is standing again.
But given that their suspicion of AK is not shared by most Turks, or by the country's Western allies, there is probably not much they - or the generals - can do about it.
The presidential election gets under way next week, with a first round of voting in parliament.
It is widely believed Mr Gul will win in the third round on 28 August.
Challenge to elite
The rise, and now the consolidation, of AK marks a transformational moment in the life of modern Turkey.
Secularists are fighting to keep the Turkish republic set up in the 1920s
A new middle class, avowedly committed both to Islam and to democracy, has emerged to challenge the traditional secular elite.
AK's political success is a reflection of this process of far-reaching social change.
The transition has not been easy.
Secularists believe they are fighting to keep the identity shaped for them by Mustafa Kemal Ataturk, who founded the modern republic in the 1920s.
But if the transition is sustained, its significance will extend beyond the country's borders to the wider Muslim world.