ISTANBUL (AP) — Turkish President Recep Tayyip Erdogan declared victory in Sunday's referendum that will grant sweeping powers to the presidency, hailing the result as a "historic decision."

Speaking to reporters in Istanbul, Erdogan said unofficial results showed the "yes" side had won by a margin of 1.3 million votes.

The president struck a conciliatory tone, thanking all voters regardless of how they cast their ballots and describing the referendum as a "historic decision."

"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 kilometers," Erdogan said.

Returns carried by the state-run Anadolu news agency showed that with nearly 99 percent of the vote counted, the "yes" vote had about 51.3 percent compared to 48.7 percent for the "no" vote.

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 concentrate 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, but nevertheless cements his hold on the country's governance.

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."

Story continues

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

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

"Our data indicates a manipulation in the range of 3 to 4 percent," 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."

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.

Sunday's vote approved 18 constitutional changes that will replace Turkey's parliamentary system of government with a presidential one, abolishing the office of the prime minister and granting sweeping executive powers to the president. The changes will come into effect with the next general election, scheduled for 2019.

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.

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."

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 neighborhood, a "yes" voter expressed full support for Erdogan.

"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.

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.

___

Fraser reported from Ankara. Bram Janssen in Istanbul and Mucahit Ceylan in Diyarbakir also contributed to this report.