Erdogan on victory: I will make Turkey a superpower
The conservative incumbent's victory was confirmed by the chief of Turkey's election authority on Monday, although the final results will be published on Friday.
Results released by Turkey's state-run Anadolu news agency based on data from the YSK also gave Erdogan a clear majority of votes.
Erdogan won 52.5 percent in the presidential poll while his main rival Muharrem Ince, of the secular Republican People's Party (CHP), was on 31.7 percent, Anadolu news agency said, based on a 99 percent vote count.
He also said his next goal would be to make Turkey a "top ten" world power, hinting at his country's increasing influence in regional conflicts such as the Syrian war and the Palestinianian issue.
'An unfair election'
Erdogan's main rival Muharrem Ince, who had challenged the incumbent leader with an energetic campaign and earlier accused the authorities of "manipulation", maintained an unusual silence after the results were announced, but was due to make a statement later on Monday.
His party bitterly complained over the publication of the election results, accusing the state-run news agency Anadolu of publishing results favourable to Erdogan early on to give the impression of an easy victory.
"Victory in the first round," trumpeted the headline in the Hurriyet daily. But the pro-opposition BirGun took a different line: "An unfair election," it said, adding that the way results had been delivered had given rise to "doubts".
The stakes were particularly high as the new president will be the first to enjoy enhanced powers under a new constitution agreed in an April 2017 referendum strongly backed by Erdogan but which opponents say grant autocratic powers.
The figures could yet change as final ballot boxes are opened. But if confirmed, the figures would show Erdogan polling on a similar rating or even stronger than his 2014 election victory where 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, according to AFP correspondents.
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 its Nationalist Movement Party (MHP) allies had won the majority in parliament.
A count of almost over 97 percent showed that Erdogan's AKP and the MHP would win 293 and 49 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.
There were also reports that Erdogan's AKP party had moved thousands of polling stations away from Kurdish areas in Turkey, to force HDP voters to walk miles to cast their ballot.
'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 was publishing a count of over 90 percent of votes while in fact short of 40 percent had been counted.
Ince had himself earlier accused Anadolu of "manipulation" but said he would only comment once official results were announced.
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.
One of the Qatari capital's biggest hotels was lit up as the Turkish flag on Sunday night, in celebration of the strongman ally's victory.
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.