The changes would replace Turkey’s parliamentary system of government with a presidential one and could see Mr Erdogan remain in office until at least 2029.

Opinion polls had shown a narrow lead for a “yes” vote before Sunday’s ballot, but the country’s three largest cities – Istanbul, Ankara and Izmir – and the mainly Kurdish southeast looked set to vote “no”.

The referendum has bitterly divided Turkey, and will affect the country’s strained relations with the European Union.

President Erdogan has insisted the changes are needed to amend the current constitution, which was written by generals following a 1980 military coup, to confront security and political challenges in Turkey and avoid past fragile coalition governments.

Image:Pro-Erdogan AK party supporters react as polling numbers are revealed in Ankara

But critics say the move grants sweeping powers to Mr Erdogan following a failed coup last July.

A statement on the High Electoral Board’s website hours before polls closed said it would count ballots that had not been stamped by officials as valid unless they could be proved fraudulent.

That triggered strong criticism from the main opposition People’s Republican Party (CHP), which said the decision caused a serious legitimacy problem in the referendum.

Erdal Aksunger, deputy chairman of the party, claimed “illegal acts” had been carried out in favour of the government in the referendum.

He said: “Since this morning, we have determined some 2.5 million problematic votes.”

Image:A security officer on a roof near a polling station in the Aegean port city of Izmir

The CHP vowed to challenge 37% of the ballot boxes, claiming on its Twitter account that data “indicates a manipulation in the range of 3 to 4%”.

The country’s pro-Kurdish opposition party added it planned to object to two-thirds of the ballots.

Residents in neighbourhoods in Istanbul banged pots and pans from their windows in protest at the result.

Under the proposals, the office of prime minister would be abolished, allowing the president to draft the budget, declare a state of emergency and issue decrees overseeing ministries without parliamentary approval.