Media reports say Turkish President Recep Tayyip Erdogan has narrowly won a referendum to expand presidential powers, which could keep him in office until 2029.

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, CNN said.

But according to Turkey’s 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.

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.

Supreme Electoral Council President Sadi Guven confirmed that the “yes” votes had prevailed, according to unofficial results.

The Guardian reports that Güven said official results would arrive in 11 or 12 days, after any objections had been considered.

Erdogan supporters reportedly say replacing the parliamentary system with an executive presidency will modernize the country.

Meanwhile, Turkey's two main opposition parties said they would challenge the results.

The Republican People's Party (CHP) demanded a recount of 60% of votes.  They criticized a decision to accept unstamped ballot papers as valid unless proven otherwise.

As jubilant Erdogan supporters rallied in the big cities, pots and pans were banged in Istanbul by opponents of the referendum, in a traditional form of protest.

Three people were shot dead near a polling station in the south-eastern province of Diyarbakir, reportedly during a dispute over how they were voting, according to the BBC.

The European Commission called on the Turkish authorities in a statement to “seek the broadest possible national consensus” when implementing the constitutional reforms.