Supporters of Recep Tayyip Erdogan celebrated until the night after Turkey's longtime president secured another five years in power.

With almost all of the votes counted, Erdogan received more than 52 percent of the vote in Sunday's runoff, beating his rival, Kemal Kilicdaroglu, who received 47.86 percent, according to the Supreme Electoral Council.

The results are expected to be confirmed in the coming days.

The poll numbers put Erdogan on course for history as he extends his 20-year rule to five more years.

He surpassed the founder of the Republic of Turkey, Mustafa Kemal Ataturk, who led the country for 15 years.

Erdogan was seen outside his residence in Uskudar, Istanbul, where he sang before thanking the crowd in the area.