Recep Tayyip Erdogan, modern Turkey’s longest-serving ruler, won a mandate to govern with sweeping new powers after a double victory in presidential and parliamentary elections.

Challenger Muharrem Ince called Erdogan’s regime a grave danger to democracy and expressed concern that Turkey is “not going to be a society governed by institutions and rules.” The country has been under emergency rule, giving the government extensive powers to suppress dissent.

The election marks “the last step towards Turkey’s transformation into a one-man regime,” said Wolfango Piccoli of Teneo Intelligence in London, a political-risk analysis firm.

With roots in a once-banned Islamist movement, Erdogan has chipped away at the secular system and Western orientation. At home, he’s ended a ban on Islamic headscarves on campuses and in state offices and has given religious education a more prominent role in schools. Abroad, he has increasingly sided with Russia in Syria’s civil war.

In the parliamentary election, the bloc led by Erdogan’s AK Party had 54 percent to 34 percent for the main opposition coalition and 12 percent for the leading Kurdish party. That would give Erdogan’s allies control of parliament. In any case, parliament’s powers will be diminished in a revamped political system.

Last year, Erdogan drove through constitutional reforms that eliminate the office of prime minister and hand the president powers to pass laws by decree, pick Cabinet ministers from outside the legislature, force new elections and declare a state of emergency.

His rivals accused the president of behaving like a dictator already, saying that his political opponents, journalists, judges and students were at risk of landing in jail in an increasingly arbitrary system. After surviving the 2016 coup attempt, Erdogan embarked on a purge of the civil service, judiciary and education system, sending tens of thousands to prison.

Opponents had promised to undo all the constitutional changes and reinstate Turkey’s century-old traditions of parliamentary democracy. That window appears to have closed, as Erdogan becomes the first Turkish president to exercise the new powers.