The referendum was seen as crucial not just for shaping the political system of Turkey but also the future strategic direction of a nation that has been a NATO member since 1952 and an EU hopeful for half a century.
The 'Yes' camp won 51.41 per cent in Sunday's referendum on a new presidential system and 'No' 48.59, according to near-complete results released by the election authorities.
But Erdogan's victory was far narrower than expected, emerging only after several nail-biting hours late Sunday which saw the 'No' result dramatically catch up in the later count.
Turkey's three largest cities -- Istanbul, Ankara and Izmir -- all voted 'No' although 'Yes' prevailed in Erdogan's Anatolian heartland.
With the opposition crying foul over alleged violations, all eyes will be on Monday's announcement by international observers from the OSCE and the Council of Europe who will give their initial assessment of the vote.
"On April 17, we have woken up to a new Turkey," wrote the pro-government Hurriyet columnist Abdulkadir Selvi.
"The 'Yes' was victorious but the people have sent messages to the government and opposition that need to be carefully considered."
The new system is due to come into effect after elections in November 2019.
'Shadow over polls'
In a bid to get back to business after the bitterly-contested campaign, Erdogan was on Monday to chair a cabinet meeting at his presidential palace, Turkish media said.
Erdogan declared that Turkey's had made a "historic" decision and appeared standing on top of a bus in front of thousands of cheering supporters outside his Huber Palace Istanbul residence on the shores of the Bosphorus.
But the opposition were not content to rest on their better-than-expected performance despite a lopsided campaign in which the 'Yes' camp enjoyed vastly greater resources and dominated the airwaves.
Both the main opposition Republican People's Party (CHP) and the pro-Kurdish Peoples' Democratic Party (HDP) said they would appeal the results from most of the ballot boxes due to alleged violations.
They were particularly incensed by a decision by the Supreme Election Board (YSK) to allow voting papers without official stamps to be counted, which they said opened the way for fraud.
"The Higher Election Board has thrown a shadow on the people's decision. They have caused the referendum's legitimacy to be questioned," said CHP chief Kemal Kilicdaroglu.
The HDP said there were indications of a manipulation amounting to three or four percentage points while deputy CHP leader Erdal Aksunger said up to 60 per cent of the ballot boxes could be appealed.
Monitors from the OSCE Office for Democratic Institutions and Human Rights (ODIHR) and the Parliamentary Assembly of the Council of Europe (PACE) are to give their own assessment of the vote at 1200 GMT.
Overnight, sporadic protests by disgruntled 'No' voters erupted in parts of Istanbul, with demonstrators banging pots and pans to voice their discontent.
"A victory of the nation," said the headline in the pro-government Yeni Safak daily. "Turkey has won."
But the Cumhuriyet opposition daily focused on the alleged violations: "A shadow fell over the ballot boxes," it said.
Reviving the death penalty?
Throughout the campaign, Erdogan launched bitter attacks on the European Union, accusing member states of behaving like the Third Reich in failing to allow his ministers to campaign among expats.
The initial reaction from Turkey's Western allies was far from ebullient, with top EU officials saying Turkey had to find the "broadest possible" agreement on the changes in view of the closeness of the result.
In an indication more strife with Brussels could be in the offing, Erdogan said he would now hold talks on reinstating capital punishment, a move that would automatically end Turkey's EU bid.
If the opposition failed to support such a bill, he said another referendum could be held on reinstating the death penalty.
The new system would dispense with the office of prime minister and centralise the entire executive bureaucracy under the president, giving Erdogan the direct power to appoint ministers.
It would also mean that Erdogan, who became president in 2014, could seek two more five-year terms leaving him in power until 2029.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)