Denmark’s centre-left has secured the most votes in a general election widely seen as a confidence vote in the country’s leader.
Prime Minister Mette Frederiksen’s “red bloc” of parties has secured the required 90 seats to form a government.
Her Social Democrats party unexpectedly gained two seats and secured its best result in two decades.
But she wants to form a broader coalition and has handed in the government’s resignation to the queen.
Ms Frederiksen was forced to call an early election in October.
It followed outrage after a highly critical report of her government’s handling of a country-wide mink cull at fur farms at the height of the pandemic was released over the summer.
In the report’s findings, the government’s order to kill up to 17 million mink in 2020 was found to have no legal basis. At the time there were fears that a mutated form of coronavirus found in mink could hamper the search for a vaccine.
Though Ms Frederiksen was found not to have known that the order was illegal, the report rattled her coalition, with one of the parties within it threatening to withdraw its support for the government if she did not call a general election.
As vote counting took place on Tuesday, it was uncertain right until the end whether Ms Frederiksen’s “red bloc” or the right-of-centre “blue bloc”, led by Jakob Ellemann-Jensen’s Liberals, would win a majority.
With this in mind, there were also suggestions that if neither group won a majority, the decision as to which would govern would end up in the hands of the recently formed Moderates party – led by two-time former Prime Minister Lars Lokke Rasmussen.
The Moderates made significant gains in the election, becoming the third-biggest party in Denmark – a considerable feat, given they did not even exist five months ago, but they will not play the role of kingmaker in the next government.
It was Ms Frederiksen’s coalition that came out on top, securing 87 seats in mainland Denmark.
They also won one seat in the Faroe Islands and are projected to win two more seats in Greenland – an autonomous Danish dependent territory of Denmark that often elects left-wing candidates. This would secure them 90 seats in the Folketinget and a one-seat majority.
Of the parties within the red bloc, Ms Frederiksen’s Social Democrats also gained two seats and took more than a quarter of the vote (27.5%), making them by far the biggest party in the Folketing.
“Social democracy had its best election in over 20 years,” Ms Frederiksen said during a speech during her election night party in the capital, Copenhagen.
She added that although her red coalition had come out on top, she wished to reach out to the centre to create a broader coalition.
“We are a party for the whole of Denmark,” she said.
On Wednesday morning, Ms Frederiksen informed Queen Margrethe of the election results and instead of carrying on as prime minister, submitted the government’s resignation and asked for a so-called queen’s round or dronningerunde – the process which precedes the formation of a government – to begin.
All the parties will visit the queen to decide who will lead coalition talks, with the role widely expected to go to Mette Frederiksen. She told supporters in the early hours of Wednesday that if appointed she would then seek to form a broad-based government.
“When the Social Democrats say something, it is something we follow through on,” she said.