Ankara (CNN) Turkish President Recep Tayyip Erdogan and the country's prime minister have declared victory in a Sunday referendum designed to hand Erdogan sweeping powers.

The Turkish Election Commission has yet to release its official results, and the opposition promised to contest at least a third of the votes cast. But according to the state-run Anadolu Agency, with 99.8% of the ballots counted, Erdogan appeared poised to win with 51.4% of voters casting ballots in his favor.

A total of 47.5 million votes were cast, Anadolu said.

Supreme Electoral Council President Sadi Guven also confirmed that the "yes" votes had prevailed, according to unofficial results. He said official results would arrive in about 10 days, after any objections had been considered.

Voters were asked to endorse an 18-article reform package put forward by the ruling Justice and Development Party that would replace the current system of parliamentary democracy with a powerful executive presidency.

"God willing, these results will be the beginning of a new era in our country," Erdogan said at a news conference Sunday night, explaining that unofficial totals indicated the "yes" votes had prevailed in the referendum by about 1.3 million ballots, while Anadolu pegged it at closer to 1.14 million.

Several groups fighting in Syria tweeted their congratulations to Turkey, and according to Anadolu, Azerbaijani, Palestinian, Qatari, Pakistani, Hungarian, Macedonian, Saudi, Sudanese and Kenyan leaders passed along congratulatory messages to Turkey's Foreign Ministry.

'This is a message to the world to shut up'

Turks celebrate at AKP headquarters in Ankara as the early results indicate a win for the "yes" ballots.

Shortly before Prime Minister Binali Yıldırım declared a victory for Erdogan, thousands converged in celebration at the Ankara headquarters of the Justice and Development Party, or AKP, that Erdogan founded. The revelers danced, sang, chanted, lit flares, honked their car horns and waved Turkish flags along with white flags saying, "Evet" -- Turkish for yes -- which appeared to be the way the majority of voters cast their ballots.

Many in attendance saw the referendum's result as an important message for the world, not just the nation. Wasin Yalcin, 24, said the vote represented "a new hope for us to get rid of foreign forces," while Yusuf Basaran, 20, said he believed "Europe's spine has cracked. This referendum will be the most effective thing in the rebirth of the Ottoman Empire."

Added Aysel Can, a member of the AKP's women's branch, "For a strong Islamic state, for a strong Middle East, Turkey had to switch to this executive presidency system. This is a message to the world to shut up; Turkey is getting stronger. America has to know this, too. We are the voice, we are the ears, we are everything for the Middle East."

JUST WATCHED Erdogan: What you need to know Replay More Videos ... MUST WATCH Erdogan: What you need to know 01:42

Erdogan called Yıldırım and the leaders of the right-wing National Movement and Great Unity parties to offer "congratulations for the referendum victory" before the final vote tally was announced, according to Anadolu.

Yildirim later took the stage at AKP headquarters in Ankara to herald a win for the "yes" vote. He said those who voted yes and those who voted no remain one, and now the country will look to improve the economy, expedite development and fight its foreign and domestic enemies.

"No one should have an offended or broken heart," the prime minister said. "There's no stopping. We will continue our path. We will continue marching on from where we left."

Partial recount coming?

JUST WATCHED Turkish referendum: A country divided Replay More Videos ... MUST WATCH Turkish referendum: A country divided 01:36

The opposition took issue with the results, saying the country's electoral authority had decided to "change the rules in the middle of the game." The High Electoral Board announced it would not accept ballots that were missing ballot commission stamps. But the board changed course after voting was underway, saying it would accept unstamped ballots "unless they are proven to have been brought from outside."

The opposition said this would affect the legitimacy of the vote and called for a partial recount of about 37% of the votes, said Erdal Aksunger of the Republican People's Party, or CHP. He left the door open to challenging a higher percentage of the ballots.

"The High Electoral Board has changed the rules after the voting started. There is a clear clause in electoral law saying unstamped ballots will be invalid and the High Electoral Board issued its notice in compliance with this law," CHP deputy chairman Bulent Tezcan said.

Later, CHP leader Kemal Kılıcdaroglu said in a news conference, "On what grounds do you declare these valid? ... You should not change the rules in the middle of the game. ... This is not right. We will never accept this."

Guven of the Supreme Electoral Council said the board has made similar decisions in the past. He said the board made the decision before results began coming in.

"Due to the complaints of non-stamped votes being given -- with the request from the representative of AKP -- our committee decided unless there is proof that they came from outside, we decided to accept non-stamped ballots and envelopes (as) valid," he said.

Three killed on election day

Turkish President Recep Tayyip Erdogan casts his vote accompanied by his wife and grandchildren.

Erdogan, who cast his vote in Istanbul amid tight security, said he hoped Turks would make the "expected" choice.

Earlier in the day, three people were reported to have died after an exchange of gunfire near a polling station in the southeastern province of Diyarbakır.

A violent argument erupted at a polling place in the village of Yabanard. Two men, age 68 and 32, were shot after two families got into an argument, Anadolu reported.

As a minibus transported the wounded men to Siverek Public Hospital, it was attacked by people with guns and stones. Another villager was injured. All three victims, who shared the same last name, later died, the news agency reported.

If passed, the measures will represent the biggest constitutional upheaval in the country since its foundation in 1923 after the demise of the Ottoman Empire.

They would cement Erdogan's grip on a country whose divisions have deepened since a failed coup attempt in July that ended with the deaths of more than 250 people and led to the imposition of a fierce crackdown on dissent.

Those who support the reforms believe they will kick-start a lethargic economy and stabilize a nation dealing with the resurgence of a 30-year conflict with militants from the Kurdistan Workers' Party. But opponents argue the proposals will lead to the formation of a constitutional dictatorship.

What does more power mean?

JUST WATCHED Turkish PM thanks voters after referendum Replay More Videos ... MUST WATCH Turkish PM thanks voters after referendum 01:41

If Erdogan prevails in the official election results, his grip on power would be considerably tightened. Term limits for the presidency would be reset and, if he wins elections in 2019 and 2024, he could be in power until 2029.

After serving as prime minster for more than a decade, Erdogan became President in 2014. By little more than force of personality, he turned a largely ceremonial post into a vehicle of significant power

He has initiated a widespread crackdown on opposition, which intensified after last year's botched coup, for which he blamed US-based cleric Fethullah Gulen

Critics say the clampdown has gone beyond the supporters of the coup and was designed to silence dissent in the run-up to the referendum.