Ousted from government by Turkey's army 10 years ago, Abdullah Gul's political rehabilitation was completed on Tuesday when the former Islamist was elected as the country's president.
Foreign Minister Gul won the third round of voting in parliament, four months after the Islamist-rooted AK Party's first attempt to have him made head of state was stymied by the powerful secular elite, including army generals.
Gul's candidacy was always controversial because of his Islamist past and the fact that his wife wears the Muslim-style headscarf, which staunch secularists consider a political act of defiance in the officially secular country.
The headscarf is banned from public offices and universities, though more than half of Turkish women wear some form of the garment.
Less attention has been paid to Gul's qualifications.
Ever-smiling, the 56-year-old is a calm diplomat who as foreign minister has overseen Turkey's difficult bid to join the European Union, while championing political and human rights reform at home and raising the country's profile abroad.
"The rose season (starts)," said Islamist-leaning daily Yeni Safak, referring to Gul's name, which means rose in Turkish.
'One of the rare wise people'
Gul served briefly as premier when the AK Party first swept to power in November 2002, while his close ally Prime Minister Tayyip Erdogan was still banned from national politics.
Foreign minister since March 2003, he has asked his critics to judge him by his pro-Western, pro-EU record and has pledged to continue to be active in foreign affairs as president.
A fluent English-speaker and former economics professor, he studied in Britain. Just as at home in the Arab world, he worked at the Islamic Development Bank in Saudi Arabia and has good personal relations with EU, US and Middle East leaders.
Gul entered parliament in 1991 with the Islamist Welfare Party. He later became a minister in the government of Necmettin Erbakan, who advocated a new Islam-based economic policy and opposed the EU and NATO. The army considered Erbakan a radical Islamist and drove him and his government from office in 1997.
"He was one of the rare wise people in that government," said columnist Cengiz Candar. "He gave an image of having his own personality, that he wasn't a follower of Erbakan ... Of being independent."
Moving closer to the centre, in 2001 Gul and Erdogan—both devout Muslims—founded the AK Party, which swept to power the following year amid a deep financial crisis.
Gul is still not secular enough for the secular elite, which considers him a threat to the republic founded by Mustafa Kemal Ataturk in 1923 after the collapse of the Ottoman Empire.
Turkey is a predominantly Muslim country of some 74 million inhabitants but has a strictly secular constitution.
Turkey's generals are horrified by the idea of a former Islamist becoming president and commander-in-chief of the second largest army in NATO, and occupying the post first held by the revered Ataturk.
While many ordinary Turks support and identify with Gul, the secular elite is also unsettled by his wife's previous efforts to take Turkey to the European Court of Human Rights over its ban on headscarves in universities.
Gul, who comes from the conservative Anatolian city of Kayseri, has pledged to be an impartial president for all Turks.
"On this historic day his wife will not be at his side," said a headline in liberal Milliyet newspaper, suggesting Gul would seek to avoid tensions as soon as he took office.
Given the symbolic weight the post holds in Turkey, many Turks expect Gul to be accepted once he takes office.