Istanbul (AFP) - Turkish President Recep Tayyip Erdogan has won tightly-contested presidential polls, the election authority said Monday, extending his 15-year grip on power as the opposition complained bitterly about the conduct of the vote count.

Turkish voters had for the first time cast ballots for both president and parliament in the snap elections, with Erdogan looking for a first round knockout and an overall majority for his ruling Justice and Development Party (AKP).

The stakes were particularly high as the new president will be the first to enjoy enhanced powers, without even a prime minister, under a new constitution agreed in an April 2017 referendum strongly backed by Erdogan but which opponents say grants autocratic powers.

Erdogan defeated his nearest rival Muharrem Ince with an "absolute majority" of more than half the vote without needing a second round, said the chief of Turkey's election authority, Sadi Guven.

"I have been entrusted by the nation with the task and duties of the presidency," Erdogan said in a victory address at his Istanbul residence, vowing that the new presidential system would be implemented "rapidly".

"Turkey has given a lesson in democracy to the entire world," he added, pointing to an 88 percent turnout.

- 'Everyone wins' -

Erdogan won 52.5 percent in the presidential poll while Ince, of the secular Republican People's Party (CHP), was on 31.5 percent, state-run Anadolu news agency said, based on a 99 percent vote count.

If confirmed, the figures would show Erdogan polling on a similar rating or even stronger than his 2014 election victory where he won his first mandate after over a decade as prime minister.

Celebrations erupted outside Erdogan's residence in Istanbul and AKP headquarters in Ankara, with crowds of flag-waving supporters, AFP correspondents said.

Erdogan flew in triumph to Ankara where he held his traditional victory speech from the balcony of AKP headquarters at 3:00 am (midnight GMT). "The winner of this election is each and every individual among my 81 million citizens," he declared.

Story continues

The usually loquacious Ince however remained silent, tweeting only that he would make a statement at 0900 GMT on Monday.

- HDP scores parliament seats -

Trailing were Selahattin Demirtas of the pro-Kurdish Peoples' Democratic Party (HDP) with over eight percent in third and Meral Aksener of the nationalist (Iyi) Good Party with over seven percent.

Erdogan also declared victory in the parliamentary election saying that the alliance led by the AKP and the Nationalist Movement Party (MHP) had won the majority in parliament.

A count of 99 percent of the votes showed that Erdogan's AKP and the MHP would win 293 and 50 seats respectively, enough for an easy majority in the 600-member chamber.

The HDP was polling 11.5 percent, well over the 10 percent minimum threshold needed, to win 67 seats which would make the party the second largest opposition faction in the new chamber.

Celebrations erupted in the Kurdish-majority city of Diyarbakir, with people letting off fireworks into the sky, AFP correspondents said.

Its success is all the more remarkable given the HDP's Demirtas has campaigned from a jail cell after his November 2016 arrest on charges of links to outlawed Kurdish militants.

- 'Don't cast a shadow' -

Erdogan had faced an energetic campaign by Ince, who has rivalled the incumbent's charisma and crowd-pulling on the campaign trail, as well as a strong opposition alliance in the legislative poll.

But the CHP expressed unease over the conduct of the count, accusing Anadolu of being over hasty in publishing results that favoured Erdogan.

Its spokesman Bulent Tezcan said Anadolu had published a count of over 90 percent of votes while in fact short of 40 percent had been counted.

Several world leaders supportive of Erdogan, including Azerbaijani President Ilham Aliyev and Qatari Emir Tamim bin Hamad Al-Thani, called to congratulate him on his "victory", the presidency said.

Erdogan also warned anyone against casting doubt on the results: "I hope nobody will harm our country's democracy by casting a shadow on the election system and its results in order to disguise their failure."

Erdogan has overseen historic change in Turkey since his Islamic-rooted ruling party first came to power in 2002 after years of secular domination. But critics accuse the Turkish strongman, 64, of trampling on civil liberties and autocratic behaviour.

The president has for the last two years ruled under a state of emergency imposed in the wake of the 2016 failed coup, with tens of thousands arrested in an unprecedented crackdown which cranked up tensions with the West.

Erdogan has also campaigned against the backdrop of increasing economic woes including high inflation and a currency that has sometimes been in freefall.

And although Erdogan dominated airtime on a pliant mainstream media, Ince finished his campaign with eye-catching mass rallies, including a mega meeting in Istanbul on Saturday, that gave hope to the opposition.