Denmark's minority government has been re-elected for a third term but a majority in parliament is possible only through an alliance with a new centre-right party.
Anders Fogh Rasmussen, the prime minister who leads the Liberal-Conservative coalition, said on Tuesday "everything indicates that the government can continue".
In conceding defeat, Helle Thorning-Schmidt of the Social Democrats, the leading opposition leader, said the Danish people needed "more time before they hand over responsibility to us".
Near-complete results showed that Rasmussen may need the backing of New Alliance which was formed early this year.
Muslim immigrants issue
"We'll incorporate the parties that have pointed at me to create the basis for the government," he said.
Since 2001, the Liberal-Conservative has relied only on the support of the nationalist Danish People's party (DPP).
New Alliance, headed by Syrian-born Naser Khader, is seeking to reduce the influence of the DPP, known for its hardline stance on immigrants, particularly Muslims.
With 99 per cent of votes officially counted, the government bloc had won 94 of the 179 seats in parliament - including New Alliance's five.
The opposition had 81 seats.
Rasmussen, in power since 2001, campaigned on his strong economic record, arguing that the country's robust economy with record low unemployment was the best guarantor of Danes' cherished welfare state.
"We have had six years of economic growth and stability and we are asking voters for a new vote of confidence to continue our work," he had said on Tuesday.