Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Turkey's main opposition parties have questioned the legitimacy of a narrow referendum vote granting President Tayyip Erdogan sweeping new powers.

Erdogan's supporters took to the streets to cheer, while opponents stayed indoors banging pots and pans in protest over the result, which heralds the biggest overhaul in Turkish politics since the founding of the modern republic — abolishing the prime minister's post and concentrating power in the presidency.

Unofficial results showed a narrow victory for Erdogan 51.4 percent of votes cast in favor. Official results are due in 12 days.

Hurriyet (top) carried the headline "New System" and while the Star bore the headline "Victory of the people" YASIN AKGUL / AFP - Getty Images

The changes won strong backing in conservative rural areas, but were just as strongly opposed in Istanbul and other cities, as well as in the Kurdish-dominated southeast — a pattern that suggests deep divisions and the possibility of unrest.

Erdogan, a populist with a background in once-banned Islamist parties, has ruled since 2003 with no real rival, while his country emerged as one of the fastest-growing industrial powers in both Europe and the Middle East.

Critics accuse him of steering Turkey towards one-man rule.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The two largest opposition parties challenged Sunday's referendum, saying it was deeply flawed. The pro-Kurdish opposition Peoples' Democratic Party said it presented complaints about unstamped ballots affecting 3 million voters, more than twice the margin of Erdogan's victory.

The main secularist opposition People's Republican Party called for the annulment of the result and its deputy party chairman Bulent Tezcan said he would if necessary go to Turkey's constitutional court.

However, Erdogan was in no mood for conciliation, telling supporters in Istanbul: "There are those who are belittling the result. They shouldn't try, it will be in vain."

He says the changes are needed to end chronic instability that plagued the country over decades when the military repeatedly tried to seize power from weak civilian governments.

"For the first time in the history of the Republic, we are changing our ruling system through civil politics," he said.

He survived a coup attempt last year and responded with a crackdown, jailing 47,000 people and sacking or suspending more than 120,000 from government jobs such as schoolteachers, soldiers, police, judges or other professionals.

The latest changes could keep him in power until 2029 or beyond, making him easily the most important figure in Turkish history since state founder Mustafa Kemal Ataturk built a modern nation from the ashes of the Ottoman empire after World War One.

Europe, which has had increasingly strained ties with Turkey, gave a cautious response. Germany, host to some 4 million Turks, said it was up to Erdogan himself to heal the rifts that the vote had exposed.

Erdogan supporters cheered his narrow victory. Elif Sogut / Getty Images

Erdogan said his next move could be a referendum to restore the death penalty. That would effectively put an end to Turkey's decades-long bid to join the European Union.

Thousands of Erdogan supporters waved flags and blasted horns into the early hours Monday in celebration of a man who they say has transformed the quality of life for millions of pious Turks marginalized for decades by the secular elite.

There were scattered protests against the result. In some affluent, secular neighborhoods, opponents stayed indoors, banging pots and pans, a sign of dissent that became widespread during anti-Erdogan protests in 2013.

Under the changes, most of which will only come into effect after the next elections due in 2019, the president will appoint the cabinet and an vice-presidents and be able to select and remove senior civil servants without parliamentary approval.

There has been some speculation that Erdogan could call new elections so that his new powers could take effect right away. However, Deputy Prime Minister Mehmet Simsek told Reuters there was no such plan, and the elections would still be held in 2019.

Pro-government media painted the result as a victory for the Turkish people, transforming a constitution left over from a 1980 military coup. The Sabah daily hailed "The People's Revolution." The Star's headline was "The People's Victory."

However, the opposition daily Cumhuriyet's headline said "The ballot box is overshadowed," reporting opposition objections to what they said were irregularities in the voting.