Erdogan was set to win 54.1 percent of the vote, way ahead of his main opposition rival Ekmeleddin Ihsanoglu on 37.4 percent, Turkish television channels said, in results based on a 60 percent vote count.
The third contender, Kurdish candidate Selahattin Demirtas, was set for 8.5 percent of the vote.
If the trend is continued, the result will mark a personal triumph for Erdogan, 60, who has promised to be a powerful president with a beefed-up mandate, in contrast to the ceremonial role fulfilled by his recent predecessors.
The polls are the first time Turkey -- a member of NATO and longtime hopeful to join the EU -- has directly elected its president, who was previously chosen by parliament, and Erdogan is hoping for a massive show of popular support.
"Our people will make an important decision for Turkish democracy," said Erdogan as he cast his vote in Istanbul alongside his wife Emine and two daughters and two sons.
Erdogan indicated that he planned to revamp the post to give the presidency greater executive powers, which could see Turkey shift towards a system more like that of France if his ruling Justice and Development Party (AKP) succeeds in changing the constitution.
"This decision has significance in that an elected president, hand-in-hand with an elected government, will lead Turkey to 2023... in a determined fashion," he said.
If Erdogan serves two presidential terms, he will stay in office to 2024 and already appears to be planning to preside over celebrations in 2023 for 100th anniversary of the foundation of the modern Turkish state.
Erdogan's opponents accuse him of undermining the secular legacy of Turkey's founding father Mustafa Kemal Ataturk, who established a strict separation between religion and politics when he forged the new state from the ashes of the Ottoman Empire.
"A ballot paper with only one name does not represent the democracy, it does not suit Turkey," said Ihsanoglu, 70, as he cast his ballot in Istanbul.
He complained that the campaign had been "unfair, disproportionate", nonetheless predicting that the votes of the "silent masses" would help him to victory.
Erdogan ran a lavish three-month campaign that swamped those of his rivals, his face glaring down at pedestrians in Istanbul from gigantic billboards at almost every street corner.
The campaign of Ihsanoglu -- a bookish former head of the Organisation of Islamic Cooperation (OIC) whose candidacy was backed by the two main opposition parties -- was modest by comparison.
While many secular Turks detest Erdogan, he can still count on a huge base of support from religiously conservative middle-income voters, particularly in central Turkey and poorer districts of Istanbul, who have prospered under his rule.
"I voted for Erdogan because I believe he is the only leader who can run the country properly. He has helped feed the poor and reached out to a larger section of our society," Zahide, 52, a retired nurse, after voting in Istanbul.
But Ozlem, 24, a university student, said she voted for Ihsanoglu. "Our country is at a turning point. It's either democracy or dictatorship. Everyone should come to their senses."
'Today is a beginning'
The third candidate Demirtas, 41, from Turkey's Kurdish minority, hoped to attract votes not just from Kurds but also secular Turks with a left-wing, pro-gay and pro-women's rights message.
"Today is a beginning. It is a beginning for all those oppressed, marginalised, those earning their bread by the sweat of their brow," he said as he cast his vote in the city of Diyarbakir.
But even though his charisma, flashing grin and fondness for white shirts with rolled-up sleeves have earned him the moniker "the Kurdish Obama" in some quarters, it would be a major achievement if Demirtas polled above 10 percent.
Erdogan endured the toughest year of his rule in 2013, shaken by deadly mass protests sparked by plans to build a shopping mall on Gezi Park in Istanbul that grew into a general cry of anger by secular Turks who felt ignored by the AKP.
Later in the year, stunning corruption allegations emerged against the premier and his inner circle, including his son Bilal, based on bugged conversations that enthralled the country like a soap opera.
The future of outgoing president Abdullah Gul, a co-founder of the AKP who appears to have distanced himself from Erdogan, is unclear. Foreign Minister Ahmet Davutoglu is tipped as a possible choice to be premier.
Recalling that he was the last Turkish president to be elected by parliament, Gul said afer voting that he wished Turkey proceeds "on its path by keeping its democracy and law stronger and consolidating its economy".