ANKARA, Turkey (AP) -- Prime Minister Recep Tayyip Erdogan won Turkey's first direct presidential election Sunday, striking a conciliatory tone toward critics who fear he is bent on a power grab as he embarks on another five years at the country's helm.
"I will not be the president of only those who voted for me, I will be the president of 77 million," Erdogan said in a victory speech delivered from the balcony of the Ankara headquarters of his Justice and Development Party , or AKP.
"Today the national will won once again, today democracy won once again," he told thousands of flag-waving, cheering supporters. "Those who didn't vote for me won as much as those who did, those who don't like me won as much as those who do."
The three-term prime minister's message of unity was in stark contrast to his mostly bitter, divisive election campaign, when he poured scorn on his opponents, cast doubt on their Turkish identity and even accused his main challenger of being part of a shadowy coup conspiracy he said was run by a former associate living in the United States.
"I want to build a new future, as of today, with an understanding of a societal reconciliation, by regarding our differences as richness, and by pointing out not our differences but our common values," he said.
Erdogan, 60, has dominated Turkish politics for more than a decade. Revered by many as a man of the people who ushered in a period of economic prosperity, he is reviled by others as an increasingly autocratic leader trying to impose his religious and conservative views on a country with strong secular traditions.
His critics have accused him of running a heavily lopsided, unfair campaign, using the assets available to him through his office as prime minister to dominate media exposure and travel across the country. His office has rejected these claims.
"Erdogan did not win a victory today, he moved to (the presidential palace of) Cankaya through chicanery, cheating, deception and trickery," said Devlet Bahceli, head of the Nationalist Action Party which backed Erdogan's main rival, Ekmeleddin Ihsanoglu.
"This person is too questionable and dubious to be seen as president," he said.
With 99 percent of ballot boxes counted, Erdogan had 51.9 percent of the vote, according to figures from the state-run Anadolu news agency, which had reporters at ballot counting stations across the country. Ihsanoglu had 38.3 percent and the third candidate, Selahattin Demirtas, had 9.7 percent.
Ihsanoglu, the 70-year-old former head of the Organization of Islamic Cooperation and a political newcomer, conceded defeat in a brief speech in Istanbul.
"I hope that the result is beneficial for democracy in Turkey," he said. "I congratulate the prime minister and wish him success."
Official results were expected Monday.
"The result was not a surprise. Opinion polls had indicated that Erdogan would obtain around 54 to 58 percent of the vote. He had dominated the election campaign," said Fadi Hakura, an associate fellow at the Chatham House think tank in London.
"Mr. Erdogan will perceive this result as a decisive mandate to push ahead with his plans for an executive form of presidency," he said.
Erdogan has vowed to transform the presidency from a largely ceremonial post into a powerful position -- something his detractors say proves he is bent on a power grab. He has said he will activate the post's rarely used dormant powers -- a legacy of a 1980 coup -- including the ability to call parliament and summon and preside over Cabinet meetings.
Hakura said the result would not alter Turkey's course.
"Nothing will change much," he said. "Neither his style of governance, neither domestic policy nor Turkey's external policy."
Legislator Huseyin Celik, the AKP spokesman, said the party -- which now must elect a new party leader and designate a prime minister to replace Erdogan -- would hold a meeting during the night and another on Monday. Erdogan is widely expected to appoint a compliant prime minister so he can continue to exert control.
Party rules barred Erdogan from serving another term as prime minister. Turkish presidents used to be elected by parliament but Erdogan's government pushed through a constitutional amendment in 2007, changing the procedure to a popular vote.
Yet the past year-and-a-half has been a turbulent one for Erdogan, who faced widespread anti-government protests in 2013 triggered by a violent police crackdown on demonstrators objecting to a construction plan in central Istanbul.
More anti-government protests erupted in May after 301 miners died in a coal mine fire blamed on shoddy safety practices. Erdogan and his son have also been implicated in a corruption scandal that he has dismissed as a coup plot by a moderate Islamic preacher and former ally living in the United States, Fethullah Gulen.