|Denmark's centre-left celebrated victory after narrowly winning a general election to end a decade in opposition [AFP]
Denmark has elected its first female prime minister, removing the right-wing government from power after 10 years in power.
Official results indicated on Thursday that Denmark's centre-left, led by Social Democrat Helle Thorning-Schmidt, won the general election and would gain a narrow majority in the 179-seat Parliament.
"We did it. Make no mistake: We have written history," the 44-year-old opposition leader told jubilant supporters in Copenhagen on Thursday.
"Today there's a change of guards in Denmark."
The opposition won 89 of the mainland seats compared to 86 for the governing coalition, according to preliminary results, with 100 per cent of votes counted.
Lars Loekke Rasmussen, the incumbent prime minister, conceded defeat, saying he would present his cabinet's resignation on Friday to Queen Margrethe, Denmark's figurehead monarch.
"So tonight I hand over the keys to the prime minister's office to Helle Thorning-Schmidt. And dear Helle, take good care of them. You're only borrowing them," Loekke Rasmussen said.
The result means the country of 5.5 million residents will get a new government that could roll back some of the austerity measures introduced by Loekke Rasmussen amid Europe's debt crisis.
A majority for the "red bloc" also deprives the anti-immigration Danish People's Party of the kingmaker role it has used to tighten Denmark's borders and stem the flow of asylum-seekers.
A power shift is not likely to yield major changes in consensus-oriented Denmark, where there is broad agreement on the need for a robust welfare system financed by high taxes.
Differing on austerity measures
But the two sides differ on the depth of austerity measures needed to keep Denmark's finances intact amid the uncertainty of the global economy.
Thorning-Schmidt said she would start government formation talks on Friday with the Social Liberals and the left-wing Socialist People's Party.
Loekke Rasmussen took credit for steering Denmark through the financial crisis in better shape than many other European countries.
However, the rebound has been slower than in neighbouring Nordic nations and the government projects budget deficits of 3.8 per cent of gross domestic product in 2011 and 4.6 per cent in 2012.
Although Denmark is not part of the debt-ridden eurozone, its currency is pegged to the euro and the country's export-driven economy is affected by shocks from Europe and beyond.
The economy emerged as the top election theme, to the chagrin of the Danish People's Party, which has used its kingmaker role in previous elections to push through immigration laws that are among Europe's toughest.
Thorning-Schmidt is not likely to make any major changes to those laws, but she has promised to overhaul a system of beefed-up customs controls at borders with Germany and Sweden, which critics say violates the spirit of European Union agreements on the free movement of people and goods.