Norway’s conservative prime minister, Erna Solberg, and her rightwing coalition government are set to hold on to power after defeating the centre-left opposition by the narrowest of margins, according to official projections.

Estimates based on a partial count of about 95% of votes cast in Monday’s general election gave 89 seats in the Storting – Norway’s 169-seat parliament – to Solberg’s Conservatives, their populist, anti-immigration Progress party coalition partners and two smaller centre-right parliamentary allies.

Solberg claimed a narrow victory, saying voters had given her “a mandate for four more years”.

“We have to be a little cautious but it looks as though we will have a non-socialist majority,” she told a rally of supporters chanting “Erna! Erna!” as confetti and streamers were dropped on the crowd.

The five-party leftwing opposition grouping, led by Labour leader Jonas Gahr Støre, was on target for 80 seats after a nailbiting campaign fought on the issues of taxation and the future of Norway’s giant energy sector.

Støre, a 57-year-old millionaire who has previously served as the country’s foreign minister, conceded defeat and wished his rival well.

“This is a big disappointment for Labour,” he told supporters.

“Our goal was to give Norway a new government. We knew it was going to be close, and it was close. But as it looks now it wasn’t enough to replace a Conservative-Progress party government with a Labour government.”

No Conservative-led government has secured a second term since 1985 and Solberg’s may well prove delicate: in the outgoing parliament, her minority coalition needed the parliamentary support of only one of its two smaller centre-right allies, but having lost seats it now needs the backing of both.

This is likely to leave the new government exposed to pressure from both the Liberals and the Christian Democrats, leading to tricky negotiations on every issue in order to obtain sufficient parliamentary backing.

Solberg, whose government piloted the country through the 2014 collapse in crude oil prices and Europe’s 2015 migrant crisis, pledged further tax cuts to boost growth, while Støre had vowed to raise taxes for the richest to reduce inequality and improve public services.

Labour, which is predicted to lose six of its 55 seats, is still on course to remain the country’s single largest party. It had seemed to be heading for a clear victory for much of the past year but shed support in recent weeks as unemployment fell and the economy recovered from the downturn.

Labour leader Jonas Gahr Støre at the party’s post-election event in Oslo. Photograph: Ntb Scanpix/Reuters

The election proved a disappointment for the Green party, widely seen as a potential kingmaker, which campaigned to halt all new oil and gas exploration and, within 15 years, phase out the sector that made Norway rich. It was on course for just 3.3% of the vote and one MP.

But the climate concerns that dominated the campaign could still see western Europe’s largest energy industry affected since Solberg, if confirmed the victor, will almost certainly need the backing of Liberals and Christian Democrats who also want limits on exploration in Norway’s sensitive Arctic waters.

The migrant crisis and economic downturn seemed to have benefited the government’s junior coalition partner, the Progress party, which was set to lose just one of the 29 seats it held in the outgoing parliament.

Analysts said the twin crises had allowed the party, seen as less nationalistic and authoritarian than Europe’s other populists, to reinforce its key anti-immigration message with its base and splash out on popular public spending projects using record withdrawals from Norway’s near-$1tn sovereign wealth fund.