Denmark has elected a young, female, centre-left leader, completing a socialist sweep of the EU's nordic states.

It also humiliated the country's main far-right party, but only after the left poached its anti-immigrant ideas.

Student or retired? Then this plan is for you.

Migrant life-jackets on display in art installation in Copenhagen city centre (Photo: TeaMeister)

"After tonight, we will put welfare first in Denmark again. Welfare, climate, education, children, future. Think of what we can do together. We now have the hope to change Denmark," Mette Frederiksen, the leader of the Social Democrat party, said after results came in on Wednesday (5 June) night.

The 41-year old, who first became an MP at the age of 24, spoke after her party won 48 out of 179 seats in the Danish parliament.

Most of the other parties in the centre-left bloc also did well.

The Social Liberals, formerly led by Denmark's EU commissioner Margerthe Vestager, doubled its seats from eight to 16.

The Socialist People's Party also doubled seats from seven to 14, while the Red-Green Alliance lost one to win 13.

That gave them a majority of 91, putting Frederiksen on course to become the country's second-ever female prime minister after Helle Thorning-Schmidt in 2011.

The centre-right bloc won 75 seats.

The figure includes the so-called Liberals party of incumbent prime minister Lars Lokke Rasmussen, which gained nine MPs to get 43.

Rasmussen accepted defeat and offered to form a grand coalition with Frederiksen.

"We had a really good election" and "Denmark is a better country now than it was four years ago," he said.

"As things stand, Mette Frederiksen has a chance to form a government, [but] I don't think it will be easy for her," he added.

He would be "standing by the phone" for coalition talks, he also said.

The Danish centre-left victory comes after socialist parties also won elections in Finland and Sweden during the past year, creating a left-wing bloc in the EU north, despite dire predictions of a right-wing surge in Europe.

At the same time, Denmark's far-right Danish People's Party (DPP) lost 21 seats to gain just 16 on Wednesday in its worst result since 1998.

A new far-right party, Stram Kurs, which wants to ban Islam, failed to reach the two-percent threshold to enter parliament.

Frederiksen had campaigned on promises to increase public spending, lower the retirement age, and hike taxes on businesses and wealthy individuals, amid steady growth following years of austerity.

"This has been a welfare election, and the voters' verdict has been completely clear. From now on, we make welfare the top priority in Denmark," she said.

She had also promised to fight climate change - a leading concern for most Danish voters, especially young ones.

Anti-migrant platform

But the socialist shine was dulled by Frederiksen's adoption of right-wing immigration policies, such as confiscating jewellery from asylum seekers, banning Islamic face veils, and seeking harsher criminal penalties for perpetrators in migrant ghettoes.

Another new far-right party, the New Right, led by Pernille Vermund, who says Muslim immigration could lead to civil war and mass rape, also entered the Danish parliament for the first time, winning four seats.

And the DPP claimed a moral victory by saying that its influence on Danish politics in recent times had shifted the country to the right.

"We succeeded in making a lot of restrictions in Denmark the last few years - we have the lowest asylum figures since 2009. Maybe [that's why] the issue now isn't so big for the public," Peter Skaarup, its parliamentary speaker, said.

Frederiksen played down her anti-migrant tactics in her victory remarks.

"Some Social Democrat voters who have been lost in the last few years, who didn't support our migration policy, are returning this time", she noted.

But her hardline stance is not shared by her coalition partners, creating potential obstacles in government talks.

Frederiksen does "not have a mandate without us. The Social Democrats do not have a victory. Their supporting parties, the green parties, have won," Martin Lidegaard, the deputy head of the Social Liberals, said.