IT WAS a vote that turned out to be as controversial as it was hotly contested. Even before all of the ballots had been counted, Recep Tayyip Erdogan, Turkey’s president, stepped in front of a crowd of supporters in Istanbul and proclaimed victory. “My nation stood upright and undivided,” he said, referring to the referendum on a constitution that will give him new, virtually unchecked powers. “April 16th was a victory for all of Turkey.”

Yet it was hardly the win Mr Erdogan had expected. The Yes camp, which the president headed, limped away with just 51.4% of the vote. The opposition accused the country’s electoral authority of foul play. Outside observers charged the government with stacking the odds in its favour. Anti-government demonstrations broke out in a number of Turkish cities. The country awoke the following morning more divided than ever.

The new constitution will bring about the most radical overhaul of the state since 1923, when it went from being an imperial Islamic power to a secular republic under Kemal Ataturk, the founder of modern Turkey. After fresh elections in 2019, Mr Erdogan will rule uncontested, appointing senior officials, judges and members of his own cabinet, with little oversight by an expanded but weakened parliament. The office of prime minister will cease to exist.

Yet the constitution is already mired in controversy. The main opposition, the secular Republican People’s party (CHP), has asked for the referendum results to be annulled. A last-minute decision by the country’s electoral board to accept unstamped ballot papers created the risk of mass fraud, the CHP said. Claims of vote-rigging, especially in the Kurdish southeast, have been pouring in. In a scathing assessment, observers from the Organisation for Security and Co-operation in Europe (OSCE), an intergovernmental body, said the board’s move had “undermined an important safeguard and contradicted the law”. A state of emergency imposed shortly after an attempted coup in July, accompanied by nearly 50,000 arrests and a climate of intimidation and nationalist hysteria, was hardly the proper setting for a referendum on systemic changes. “Voters were not provided with impartial information about key aspects of the reform and limitations on fundamental freedoms had a negative effect,” the OSCE said.

There is next to no chance of a recount. The electoral board rejected the opposition’s appeal on April 19th, but promised to look into individual allegations of fraud. (Official results are expected towards the end of April.) Mr Erdogan asked foreign observers to keep their concerns to themselves. “We don’t care about the opinions of ‘Hans’ or ‘George’,” he said. His prime minister added: “The people’s decision is clear and the result is a Yes.”

The allegations will haunt Mr Erdogan for years, leaving the country even more polarised than before. Mr Erdogan might be “the most unassailable Turkish leader since Ataturk but this legitimacy issue will hang over his head,” says Soner Cagaptay, a fellow at the Washington Institute.

International reaction has been muted. Other than Donald Trump’s America, which joined model democracies such as Russia, Sudan, Hungary and Djibouti in congratulating Mr Erdogan, no leader of a big Western country has welcomed the vote. Britain, Germany and the EU called instead for dialogue and an impartial inquiry. Mr Erdogan did not appear particularly keen to rebuild bridges with Europe: on the day of the vote, he pledged once again to do his part to reinstate the death penalty, which would threaten the membership of Turkey in the Council of Europe and torpedo its already comatose accession talks with the EU.

One-man show

Supporters of the new constitution say it will improve decision-making by concentrating power in Mr Erdogan’s hands, precluding unwieldy political coalitions and neutralising powerful unelected officials. “From now on, it’s the people who are going to rule Turkey,” says Ufuk, a young Yes voter relaxing outside a polling booth.

Opponents say it will transform the government, already dominated by Mr Erdogan, into an authoritarian regime. “This is the beginning of one-man rule,” says Ali Bayramoglu, a columnist who used to be sympathetic to the ruling Justice and Development (AK) party. After he said earlier this month that he would oppose the new constitution, Mr Bayramoglu was assaulted by AK supporters at a polling station on the day of the vote.

Some of the changes will come into effect immediately. An impartiality clause that required the president to sever links with any political party (which he flouted) will expire. Mr Erdogan is expected formally to rejoin AK as soon as official results are announced this week. Within a month, the country’s most influential judicial body, the council of judges and prosecutors, will shrink and move from a system of election by peers to one of appointment by parliament and the president.

Mr Erdogan’s initial comments suggest he will disregard the slim margin of victory and portray the referendum as a sign of support for his crackdown. The day after the vote, his government extended the state of emergency until July 19th. Two days after that, police arrested some 38 people accused of participating in protests.

Turkey is saddled with a constitution opposed by nearly half of all voters in a referendum tainted by fraud claims and held under conditions that made open debate impossible. Mr Erdogan has the powers he has long coveted. They come at the cost of tension at home and isolation abroad.