Turkey's controversial Foreign Minister Abdullah Gul has been sworn in as the country's new president.
He is the first politician with an Islamist background to become head of state since the creation of the deeply secular Turkish Republic in 1923.
His swearing-in follows a third round of voting in parliament, which he won by a clear majority.
Mr Gul took his oath at a ceremony in parliament, pledging loyalty to democracy and to the secular Republic.
"As long as I am in office, I will embrace all our citizens without any bias," he said.
Mr Gul used to belong to an Islamist party, and his candidacy split Turkey for months, inspiring street protests and forcing an early general election.
On Monday the military warned about threats to the secular constitution.
Boost for EU talks
The European Union welcomed Mr Gul's election, calling it a positive step in the country's campaign to join the bloc.
European Commission chief Jose Manuel Barroso said the election was "an opportunity to give fresh, immediate and positive impetus to the accession process to the European Union through progress in a number of key areas".
Turkey was made a candidate for EU membership in October 2005, but the talks are blocked on a number of fronts.
Joost Lagendijk, the Euro-MP who leads the EU-Turkey delegation, called on Mr Gul to reassure critics he posed no threat to Turkey's secular order.
Mr Gul, whose wife wears a Muslim headscarf, has pledged to respect Turkey's secular institutions.
The headscarf is currently banned from public institutions in Turkey and Mr Gul has said wearing it is a matter of personal choice.
Mr Gul secured 339 votes in the 550-seat parliament, which is dominated by the AKP, following the party's triumph in an early general election last month. He had needed a simple majority of 276 votes in the third round.
Two earlier rounds after the election had not produced the two-thirds majority that Mr Gul needed.
Mr Gul, who has established himself as a skilled diplomat by steering Turkey towards European Union entry talks, has pledged to be a ruler for all Turks.
Turkey's military chief warned on Monday that "centres of evil" were trying to undermine the state.
Gen Yasar Buyukanit did not name those he said were "trying to corrode the secular nature of the Turkish Republic."
But analysts said the statement was clearly aimed at Mr Gul, a devout Muslim.
The army, which sees itself as the guardian of Turkey's secularism, has ousted four governments in the past 60 years.
It was the second warning issued by the military in recent months.
In April, the army expressed its concern after Mr Gul only narrowly failed to gain enough support from MPs to become president in a first round.
Secularist politicians also organised mass demonstrations by their supporters in an effort to block Mr Gul's presidential bid.
The stand-off between the AKP and secularist parties triggered a political crisis that led to snap elections in July.
The AKP won those polls convincingly with 47% and again nominated Mr Gul for the post of president.
Turkey's military and secular establishment suspect he might harbour a secret Islamist agenda.
The founder of modern Turkey, Mustafa Kemal Ataturk, banished religious influence from public life when he founded the modern Western-style republic on the ruins of the Ottoman Empire.