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.9% of the votes after a campaign in which party leaders vowed a tough stance against immigration.
Mette Frederiksen, the party's leader, said late Wednesday that 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 Frederiksen won't 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 center-right from getting a chance. The Social Democrats and other left-of-center parties appear headed to having one more vote than a majority in the 179-seat parliament, the Folketing.
With nearly 100 percent 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 center-right Liberals, was hit with a big drop in support, meaning 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 party in the outgoing parliament, but its vote share plunged to about 9% Wednesday, compared to 21.1% in 2015.
Loekke Rasmussen conceded defeat and would resign Thursday. "You have chosen that Denmark should have a new majority, that Denmark should take a new direction," Frederiksen said told a jubilant crowd at parliament. "And you have chosen that Denmark should have a new government."
At age 41, 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 Loekke Rasmussen's government to tighten immigration. "This is really, really bad," People's Party leader Kristian Thulesen Dahl said of his loss at the polls, but he said the party would not change its politics.
The Hardliner Course party didn't cross the 2% threshold needed to enter Parliament. The New Right, another openly anti-Muslim group that also fielded candidates for the first time, will be in the legislature after getting 2.4% of the votes.
This story has been corrected to show that the name of leader of the Danish People's Party is spelled Kristian Thulesen Dahl.