Turkish President Recep Tayyip Erdogan won a historic referendum Sunday that will greatly expand the powers of his office, although opposition parties questioned the outcome and said they would challenge the results.

With 99 per cent of the ballots counted, the "yes" vote stood at 51.37 per cent, while the "no" vote was 48.63 per cent, according to the state-run Anadolu Agency. The head of Turkey's electoral board confirmed the "yes" victory and said final results will be declared in 11-12 days.

Although the margin fell short of the sweeping victory Erdogan had sought in the landmark referendum, it could nevertheless cement his hold on power in Turkey and is expected to have a huge effect on the country's long-term political future and its international relations.

The 18 constitutional amendments that will come into effect after the next election, scheduled for 2019, will abolish the office of the prime minister and hand sweeping executive powers to the president.

In his first remarks from Istanbul, Erdogan struck a conciliatory tone, thanking all voters no matter how they cast their ballots and calling the referendum a "historic decision."

Turkey Referendum

Supporters of the 'yes' vote celebrate in Istanbul on Sunday. (Petros Karadjias/Associated Press)

"April 16 is the victory of all who said yes or no, of the whole 80 million, of the whole of Turkey of 780,000-square kilometres," Erdogan said.

But he quickly reverted to a more abrasive style when addressing thousands of flag-waving supporters in Istanbul.

"There are those who are belittling the result. They shouldn't try, it will be in vain," he said. "It's too late now."

Responding to chants from the crowd to reinstate the death penalty, Erdogan said he would take up the issue with the country's political leaders, adding that the question could be put to another referendum if the political leaders could not agree.

​Turkey's main opposition party vowed to challenge the results reported by Anadolu agency, saying they were skewed.

Erdogan has long sought to broaden his powers, but a previous attempt failed after the governing party that he co-founded fell short of enough votes to pass the reforms without holding a referendum.

Opponents argued the plan concentrates too much power in the hands of a man they allege has shown increasingly autocratic tendencies.

The outcome is expected to have a huge effect on Turkey's long-term political future and its international relations. Although the result, if officially confirmed, would fall short of the sweeping victory Erdogan had sought, it nevertheless cements his hold on the country's governance.

APTOPIX Turkey Referendum

Fatma Canpolat, a paralyzed woman who was wheeled into a polling station, casts her ballot in Erzincan, Turkey, on Sunday. (Depo Photo via AP)

Prime Minister Binali Yildirim, whose position will be eliminated under the presidential system of government called for in the referendum, also welcomed the results and extended a hand to the opposition.

"We are all equal citizens of the Republic of Turkey," he said. "Both the ones who said `no' and the ones who said `yes' are one and are equally valuable."

"There are no losers of this referendum. Turkey won, the beloved people won," Yildirim said, adding that "a new page has opened in our democratic history with this vote. Be sure that we will use this result for our people's welfare and peace in the best way."

Erdogan supporters gathered outside the AK Party headquarters in Istanbul to celebrate, sending fireworks into the night sky.

Opposition claims data 'manipulation'

But the main opposition People's Democratic Party, or CHP, cast doubt on the results. CHP vice chairman Erdal Aksunger said the party would challenge 37 per cent of the ballot boxes.

"Our data indicates a manipulation in the range of three to four per cent," the party said on its Twitter account.

The country's pro-Kurdish opposition party, which also opposed the constitutional changes, said it plans to object to two-thirds of the ballots.

An unprecedented decision by Turkey's Supreme Election board to accept as valid ballot papers that don't have the official stamp also drew the ire of the CHP, with the party's deputy chairman, Bulent Tezcan, saying the decision had left the referendum "with a serious legitimacy problem."

Turkey Referendum

A supporter stands with a sticker on her head that reads 'no' in Kurdish during a rally in Diyarbakir, Turkey, on Saturday. Supporters of the 'no' vote have complained of an atmosphere of intimidation. (Emre Tazegul/Associated Press)

The board made the announcement after many voters complained about being given ballot papers without the official stamp, saying ballots would be considered invalid only if proven to have been fraudulently cast.

But electoral board head Sadi Guven defended the decision.

"There is no question of changing the rules in the middle of the game," he said.

The reforms allow the president to appoint ministers, senior government officials and half the members of Turkey's highest judicial body, as well as to issue decrees and declare states of emergency. They set a limit of two five-year terms for presidents and also allow the president to remain at the helm of a political party.

Germany Turkey Referendum

A woman reacts while watching a live broadcast of the Turkish referendum results during an event organised by the Turkish Republican People's Party in Berlin, Germany, on Sunday. (Sebastian Willnow/dpa via AP)

Erdogan and his supporters had argued the "Turkish-style" presidential system would bring stability and prosperity in a country rattled by a failed coup last year that left more than 200 people dead, and a series of devastating attacks by the Islamic State group and Kurdish militants.

But opponents fear the changes will lead to autocratic one-man rule, ensuring that the 63-year-old Erdogan, who has been accused of repressing rights and freedoms, could govern until 2029 with few checks and balances.

The ballots themselves did not include the referendum question — it was assumed to be understood. Voters used an official stamp to select between "yes" and "no."

Referendum comes amid turmoil

At one Istanbul polling station, eager voters lined up outside before it opened at 8 a.m.

"I don't want to get on a bus with no brake system. A one-man system is like that," said Istanbul resident Husnu Yahsi, 61, who said he was voting "no."

In another Istanbul neighbourhood, a "yes" voter expressed full support for Erdogan.

'I don't want to get on a bus with no brake system. A one-man system is like that' - Istanbul resident Husnu Yahsi

"Yes, yes, yes! Our leader is the gift of God to us," said Mualla Sengul. "We will always support him. He's governing so well."

Erdogan first came to power in 2003 as prime minister and served in that role until becoming Turkey's first directly elected president in 2014.

The referendum campaign was divisive and heavily one-sided, with the "yes" side dominating the airwaves and billboards across the country. Supporters of the "no" vote have complained of intimidation, including beatings, detentions and threats.

Turkey Referendum

Supporters of the 'yes' vote celebrate in Istanbul on Sunday. (Emrah Gurel/Associated Press)

The vote comes as Turkey has been buffeted by problems. Erdogan survived a coup attempt last July, which he has blamed on his former ally and current nemesis Fethullah Gulen, an Islamic cleric living in the United States. Gulen has denied knowledge of the coup attempt.

Still, a widespread government crackdown has targeted followers of Gulen and other government opponents, branding them terrorists and a state of emergency has been imposed.

Roughly 100,000 people — including judges, teachers, academics, doctors, journalists, military officials and police — have lost their jobs in the government crackdown, and more than 40,000 have been arrested. Hundreds of media outlets and non-governmental organizations have been shut down.

Turkey has also suffered renewed violence between Kurdish militants and security forces in the country's volatile southeast, as well as a string of bombings, some attributed to the Islamic State group, which is active across the border in Syria.

The war in Syria has led to some 3 million refugees crossing the border into Turkey. Turkey has sent troops into Syria to help opposition Syrian forces clear a border area from the threat posed by Islamic State militants.

Meanwhile, Turkey's relations with Europe have been increasingly tense, particularly after Erdogan branded Germany and the Netherlands as Nazis for not allowing Turkish ministers to campaign for the "yes" vote among expatriate Turks.