Danish voters ousted Prime Minister Helle Thorning-Schmidt in an election on Thursday and handed power to an opposition center-right alliance including huge gains for a eurosceptic, anti-immigrant party.
Opposition leader Lars Lokke Rasmussen said he would try to form a government but is likely to have to make big concessions to ensure support from the right-wing Danish Peoples' Party (DF), which ended up with more votes than his Liberal Party.
With all of the votes counted on the mainland, the center-right won 90 seats in parliament to 85 seats for the center-left bloc of Thorning-Schmidt, who wrongly gambled that an economic upturn would win her re-election.
Denmark's first female prime minister, elected in 2011, Thorning-Schmidt conceded defeat and quit as party leader after the vote.
DF, the second-biggest party behind Thorning-Schmidt's Social Democrats, has supported the Liberals in government before and its backing gives the center-right led by Rasmussen its overall majority.
"Tonight we have been given an opportunity, but only an opportunity, to take leadership in Denmark," Rasmussen told supporters in parliament.
"We take that upon ourselves and I take that upon myself ... What I offer today is to put myself at the head of a government," he said.