COPENHAGEN (Reuters) - An opposition centre-right alliance led by former prime minister Lars Lokke Rasmussen was poised to take power in Denmark after an election on Thursday that also gave a big boost to an anti-immigration, right-wing party.
With all of the votes counted on the mainland, state broadcaster DR projected 90 seats for the opposition coalition in parliament to 85 seats for the ruling centre-left bloc of Prime Minister Helle Thorning-Schmidt, who wrongly gambled that an economic upturn would win her re-election.
The results represent a surprise yet clear victory for the bloc led by Rasmussen, even though his Liberals party won fewer votes than the right-wing Danish People's Party (DF) which is part of his alliance. DF becomes the second largest party in parliament after Thorning-Schmidt's Social Democrats.
Despite the outcome, DF has been coy about whether it would even enter a government for the first time in its 20-year history.
"What we have said before the election is also what we will follow after the election - that we will be where the political influence is greatest," said DF leader Kristian Thulesen Dahl.
"If that is in a government, then that is where we will be. If it is outside of the government, then that it where we will be. That is the driver for us, not ministerial titles."
Opinion polls throughout the campaign, as well as exit polls, put the centre-left and centre-right neck and neck. Thorning-Schmidt called an early election, hoping to capitalize on an economic recovery that followed unpopular reforms after she took power as Denmark's first female premier in 2011.
The centre-left parties supporting her closed a wide gap in recent months and the momentum appeared to be with her, as her personal ratings were far higher than those of Rasmussen.
But Rasmussen reminded voters of the promises broken after the 2011 election when she cut unemployment benefits and student grants as the economy slumped. DF's campaign on restricting immigration also seems to have resonated with many disenchanted voters.
Coalition building by the opposition bloc is now expected to take place and may last days or several weeks. While polls had projected a strong result for DF, political pundits did not expect the party to form a government by itself.
When asked whether he saw Dahl as prime minister, Liberal Party vice chairman Kristian Jensen said: "I have a good imagination, but it has its limits".
"Lars Lokke Rasmussen has been heading the mediation ... between the conservative parties for three and a half years. And he will also be heading the mediation for a cooperation in a new conservative government if this forecast becomes reality, which it seems that it will," Jensen said.
While the Liberals and DF agree on most policy points, they disagree on public spending - Rasmussen wants to freeze it while Dahl wants to increase it in a country that is the largest state spender as a percentage of gross domestic product in the Organisation for Economic Cooperation and Development (OECD).
But DF has managed to set the agenda on some issues - parties across the aisle talked about curbing immigration while it won an important concession from centre-right parties on its stance on the European Union.
Just before the election they agreed should they come into power, they would make it government policy to support British Prime Minister David Cameron's bid to reform the EU. DF wants to go further and call an in-or-out referendum on EU membership.
Writing by Sabina Zawadzki and Alister Doyle; additional reporting by Alexander Tange, Annabella Pultz Nielsen and Erik Matzen; editing by Ralph Boulton and G Crosse