WASHINGTON, DC - MARCH 31: Recep Erdogan, President of the Republic of Turkey arrives for the working dinner for the heads of delegations at the Nuclear Security Summit on the South Lawn of the White House March 31, 2016 in Washington, D.C.. (Photo by Ron Sachs-Pool/Getty Images)

President Tayyip Erdogan has retained office after two decades as Prime Minister and President separately. He and supporters on Monday revelled in an election victory lengthening his rule into a third decade while Turkey’s opposition, which once counted on winning, braced for “difficult days” against an increasingly autocratic government.

The election had been seen as Erdogan’s biggest political challenge, with the opposition confident of unseating him and reversing his policies after polls showed a cost-of-living crisis left him vulnerable.

But he prevailed with 52.2% of the vote to Kilicdaroglu’s 47.8%. It reinforced Erdogan’s image of invincibility in the deeply divided NATO-member country, whose foreign, economic and security policy he has redrawn.

Pro-government newspapers, part of an overwhelmingly pro-Erdogan media landscape that buoyed his election campaign in the nation of 85 million people, cheered his victory.

“It’s a good result because Tayyip Erdogan is a good leader, he knows what the people want. If people have been voting for him for 20 years, he must be a successful leader,” said Altay Sahin, a construction worker in Istanbul.

Addressing supporters in a victory speech, Erdogan declared democracy the winner. “Now is the time to put the disputes and conflicts of the election period to one side and unite around our national goals,” he said.

But the prospect of five more years of Erdogan rule was a harsh blow to an opposition which accused him of undermining democracy as he amassed ever more power – a charge he denies. Kilicdaroglu had promised a new “spring” if he had won.

His rival Kemal Kilicdaroglu said it was “the most unfair election in years” but did not dispute the outcome, which gave Erdogan a mandate to pursue policies that have polarised Turkey and strengthened its position as a regional military power.

“I look at the people around me, who were supporting the opposition, and all of them are resentful,” said Hulya Yildirim, a lawyer. “We forgot about spring in this country, we have to make our own spring because the people seem to be happy with winter.”

The lira slipped to a record low of 20.08 against the dollar. It has lost 90% of its value in the last decade, buffeted by currency crisis and rampant inflation.

Its most recent losses were driven by uncertainty about what an Erdogan win would mean for economic policy. Critics have blamed his unorthodox, low interest-rate economic blueprint that the opposition had pledged to reverse, for the currency’s woes.

Erdogan said inflation, which hit a 24-year peak of 85% last year before easing, is Turkey’s most urgent issue.