Addressing supporters atop a bus in Istanbul, Erdogan, who has led Turkey for two decades, thanked people for voting and said he completed Sunday's runoff vote against challenger Kemal Kilicdaroglu with their support.
The victory extends Erdogan's two decades in power and gives him a mandate to pursue increasingly authoritarian policies which have polarised Turkey and strengthened its position as a regional military power.
Ahmet Yener, head of Turkey’s high electoral board, confirmed the victory for Erdogan at a news conference late on Sunday.
Official results showed Kilicdaroglu won 47.9% of the votes to Erdogan's 52.1%, pointing to a deeply divided nation.
Kilicdaroglu called it "the most unfair election in years" but did not dispute the outcome. He called on his supporters to continue the "struggle for democracy," "for your children, for the retirees, for our mothers and fathers, for our farmers and tradesmen.”
Erdogan appeared to have prevailed despite years of economic turmoil which critics blame on unorthodox economic policies which the opposition had pledged to reverse.
Reuters reported last week that there is disagreement within Erdogan's government over whether to stick with what some call an unsustainable economic programme or to abandon it.
World leaders have been congratulating Erdogan on his electoral victory throughout the evening.
Reuters