The Social Democrats emerged as Denmark's biggest party after its elections on Wednesday, with preliminary results indicating gains for left-leaning parties and a big loss for populists.
If confirmed in final returns, the outcome pointed to the Social Democrats returning to power after four years as the country's leading opposition party.
The Social Democrats got about 25.9pc of the votes after a campaign in which party leaders vowed a tough stance against immigration.
Mette Frederiksen, the party's leader, said the Social Democrats will try to govern as a minority rather than form a governing coalition with smaller parties.
It will seek support from the right on some issues, such as immigration, and from the left on other matters, such as social welfare, she said.
Although Ms Frederiksen will not try to form a coalition, other left-leaning parties that increased their vote shares will likely support her effort to form a government to avoid the centre-right from getting a chance.
The Social Democrats and other left-of-centre parties appear likely to have one more vote than a majority in the 179-seat parliament, the Folketing.
With nearly 100pc of the votes counted, the Liberal Party of Prime Minister Lars Loekke Rasmussen showed a slight gain from four years ago.
But the populist Danish People's Party, which often voted with the centre-right Liberals, was hit with a big drop in support, meaning Mr Loekke Rasmussen can no longer muster a majority in parliament.
The Danish People's Party's performance was a contrast to some other European countries, where far-right populists have been on the rise.
The party was the second-largest in the outgoing parliament, but its vote share plunged to about 9pc, compared to 21.1pc in 2015.
Mr Loekke Rasmussen conceded defeat and said he would resign yesterday.
"You have chosen that Denmark should have a new majority, that Denmark should take a new direction," Ms Frederiksen told a jubilant crowd at parliament. "And you have chosen that Denmark should have a new government."
At the age of 41, Ms Frederiksen could become Denmark's youngest-ever prime minister.
"The election campaign is now over. It's time to find solutions," she said.
Many Danish People's Party voters have drifted to the Social Democrats, mainly because of it readopting tough views on immigration. The party advocated restricting immigrants in the 1980s and 1990s but softened its position later while in a coalition with left-wing parties.
Its lawmakers voted for several laws introduced by Mr Loekke Rasmussen's government to tighten immigration.