The Turkish parliament on Tuesday elected Foreign Minister Abdullah Gul as Turkey's 11th president in a vote that has pitted staunch secularists and the ruling Islamist-rooted Justice and Development Party (AKP).
Gul won 339 votes in the parliamentary poll, easily defeating Sabahattin Cakmakoglu with 70 votes and Huseyin Tayfur Icli with 13. Twenty-four voted "none of the above" and two votes were declared invalid.
Tuesday's poll was the third round of voting. During the previous two rounds last week Gul failed to receive a two-thirds majority. For the third round Gul needed just a simple majority of 276 votes in the 550-seat parliament.
Gul was to be sworn in at a parliamentary ceremony later on Tuesday and take over from current President Ahmet Necdet Sezer on Tuesday night.
Gul's bid to become president has become a controversial issue owing to past involvement in Islamist groups and the fact that his wife Harunisa wears an Islamic-style headscarf. It is illegal for state employees and university students to wear headscarves.
Hayrunisa Gul will become the first wife of a president to wear a headscarf. In a move designed to calm secularists' fears, Harunisa announced earlier on Tuesday that she will not attend the swearing-in ceremony.
Staunch secularists fear that with the AKP controlling both the government and the presidency there will be moves to water down strict separations in public life between religion and state.