Turkish Foreign Minister Abdullah Gul was elected as new president in the third round of presidential voting in the parliament on Tuesday, the Parliament Speaker Koksal Toptan said.
Toptan said that Gul, who was renominated by the ruling Justice and Development Party (AKP) as a candidate, received 339 votes.
The candidate from the Nationalist Movement Party (MHP), Sabahattin Caknakoglu, collected 70 votes while the third candidate, Tayfun Icli from the Democratic Left Party (DSP), got 13 votes, according to Toptan.
While the first and second rounds of voting require 367 votes -- two-thirds of 550 MPs -- to elect the new president, in the third round held on Tuesday, a simple majority of 276 votes would be sufficient.
Turkey's secular elite have strongly opposed to the nomination of Gul, a controversial figure with an Islamist background, and the main opposition Republican People's Party has called on the AKP to name a compromise candidate for the post.
Gul's first bid for the presidency failed in May after the parliament's general assembly failed to reach a quorum of 367 voters needed to elect a new president due to the opposition boycott, prompting Prime Minister Recep Tayyip Erdogan to call an early parliamentary election.
The ruling AKP won a sweeping victory in the July 22 parliamentary elections and now holds 341 seats in parliament, more than enough to put Gul to the top job.
An oath-taking ceremony for the new president is expected to be held at the parliament on Tuesday evening.