COPENHAGEN (Reuters) - Denmark appeared set to become the third Nordic country in a year to form a leftist government as voters in Wednesday’s parliamentary election rebelled against austerity measures and dealt a blow to right-wing nationalists.

Danes looked to oust Prime Minister Lars Lokke Rasmussen in the election, paving the way for an attempt by Social Democratic leader Mette Frederiksen, 41, to become Denmark’s youngest-ever prime minister as her party led in seats together with the rest of the left-wing opposition.

Following two decades of liberal economic reforms in Denmark, the vote marked a comeback for a Social Democratic Party, which was the main architect behind the cradle-to-grave welfare state when it was the traditional party of power throughout the 20th century.

The leftist opposition bloc got 96 seats against 79 for the ruling Liberal Party and others on the right, the final vote count showed.

The nationalist Danish People’s Party, which has supported Rasmussen’s minority government, appeared to have lost its edge with most mainstream parties backing a tougher stance on immigration. Support for the party plummeted to 8.7% from 21.1% in the 2015 election.

Rasmussen, who has been premier since 2015 and also served from 2009 to 2011, said late on Wednesday that he would announce his government’s resignation to Queen Margrethe on Thursday.

Frederiksen’s promise to increase welfare spending after years of austerity along with her tougher stance on immigration went down well with voters in opinion polls ahead of the vote.

Slideshow ( 7 images )

‘WELFARE ELECTION’

The Nordic model has been the gold standard for welfare for many left-leaning politicians globally, including U.S. Democratic presidential candidate Bernie Sanders, who has pointed to Denmark as a model for his vision of an ideal American future.

But ageing populations have prompted Nordic governments to chip away at the cradle-to-grave welfare state.

“This has been a welfare election, and voters’ verdict has been completely clear. From now on, we make welfare the top priority in Denmark,” Frederiksen said in a speech after the final election result.

Many Danes, who like counterparts in other Nordic states pay some of the highest taxes in the world to underpin their welfare system, worry that further austerity will erode the universal healthcare, education and elderly services long seen as a given.

Denmark, which is home to companies like container shipper Maersk, toymaker Lego and brewer Carlsberg, has seen economic growth above the European Union average in the past decade.

Slideshow ( 7 images )

In Finland and Sweden, the Social Democratic parties also formed governments earlier this year.

In Denmark, the Social Democrats remained the biggest party, with support holding at 2015 levels, according to the vote count.

Frederiksen will attempt forming a minority one-party government, she said on Wednesday, but may find it difficult to combine her own party’s tougher immigration policies with the softer stance of most parties on the left.

The Social Democrats have backed tougher legislation, including a ban on wearing the body-covering Islamic burqa and niqab face veil in public, as well as a “jewellery bill” that allows police to seize refugees’ valuables to help pay their costs.

The parties Frederiksen will rely on include the Socialist People’s Party and the Social-Liberal Party, the latter which used to be headed by European Competition Commissioner Margrethe Vestager. Both parties looked to more than double their support.

Both have campaigned for a more gentle immigration policy and greater efforts to combat climate change, echoing a surge in support for Europe’s Greens at European Union elections last month, surfing a global wave of climate activism.

A new Danish far-right party, ‘Stram Kurs’, which means Hard Line, that wants Islam banned and hundreds of thousands of Muslims deported, did not gain any seats in parliament.

Greenland and the Faroe Islands, which are part of the Kingdom of Denmark with wide autonomy, each have two of parliament’s 179 seats.