Supporters of Turkey's governing AK Party are celebrating after the country's prime minister claimed a comprehensive general election victory.
Mr Erdogan said that "democracy has passed a very important test"
Recep Tayyip Erdogan vowed to work for national unity after his party won re-election with almost 50% of votes.
He told cheering crowds in Ankara that the AKP victory was a triumph for Turkish democracy.
Opponents had insisted that a win for the Islamist-rooted AKP could undermine Turkey's secular traditions.
The election was called after opposition parties in parliament blocked the AK Party's nominee for the post of president, causing political deadlock.
But the BBC's Chris Morris, in Ankara, the Turkish capital, says the AKP has now scored a stunning victory, and those who still believe it is a threat to the secular system are clearly in a minority.
Reports said the AKP had won about 47% of the nationwide vote after some three-quarters of votes were counted.
Two opposition parties won the 10% share needed to guarantee seats in parliament: the secularist Republican People's Party (CHP) polled 20%, and the right-wing Nationalist Action Party (MHP) 14%.
Those gains meant the AK Party would have about 340 seats in the 550-member parliament, Turkish media said.
Estimates said the CHP would win 112 seats and the MHP 70 seats, with about 25 going to independent candidates, including pro-Kurdish politicians.
Speaking in Ankara, Mr Erdogan said his party would continue pursuing Turkey's ambitions of joining the European Union.
In front of cheering crowds waving Turkish flags and the blue flags of the AKP, Mr Erdogan said he would work for all Turkish people, no matter who they had voted for.
"Democracy has passed a very important test," he said, pledging to continue economic and democratic reforms.
"Whoever you have voted for... We respect your choices. We regard your differences as part of our pluralist democracy. It is our responsibility to safeguard this richness."
He also vowed to continue the fight against Kurdish rebels in the east of Turkey.
Voting was compulsory and turnout was reported to be extremely high.
Some 42 million people were eligible to vote in the poll, while 14 parties vied for seats in parliament.
Poling stations were busy from early on Sunday, with supporters of the secular establishment out in force as well as AKP voters.
Many people broke into applause as Turkey's military chief of staff arrived to cast his vote.
In the run-up to the election generals had warned that the army was prepared to step in to defend Turkey's strict secular system.
The deadlock in parliament emerged when the AKP tried to nominate Abdullah Gul, a former foreign minister, for the post of president - traditionally a secular figurehead for the republic.
Opposition parties blocked Mr Gul's appointment, as well as government reforms proposing direct elections to choose a president.
Turkey's current president and its secularist establishment have vowed to resist what they regard as the Islamist agenda of the AK Party.
Mr Erdogan's government dismisses that portrayal, pointing to its record of five straight years of economic growth and the start of membership negotiations with the European Union.