Prime Minister Erna Solberg's minority government had until Monday to secure majority support from its centrist allies in parliament, the Christian Democrats and Liberals, to pass its 2017 finance bill.
But a solution was found after talks stretched into the weekend, Solberg told a press conference.
"You have to give and receive to reach unity, which is exactly what we've done," she said.
Saturday's compromise included an extra 6 billion kroner (670 millioneuros) for climate and environmental measures, family policy, education and research and rail transport, according to Norwegian media.
The talks had been thrown into crisis on Tuesday when the Liberal Party announced its withdrawal from the budget negotiations, unhappy with a lack of measures to combat climate change.
In its draft budget, the government had proposed to raise the price of diesel by 0.35 kroner (4 euro cents) per litre and that of petrol by 0.15 kroner per litre, while at the same time giving motorists other tax breaks.
Presented as non-negotiable, the proposal had fuelled anger among the Liberals.
The government suggested that the measures would still appear in the budget, without giving further details.
Without a last-minute compromise, the government would have been forced to call a vote of confidence in parliament. A defeat would have triggered negotiations to form a new government, potentially led by the opposition Labour party.
The Norwegian constitution does not allow for early elections, with the next legislative vote scheduled for September 11, 2017.