Lawmakers have voted for Norway, a major energy-producing nation, to become carbon-neutral by 2030, two decades ahead of schedule, as a result of the UN's December 2015 climate accord.

A resolution was approved by MPs late Tuesday in a 54-47 vote despite opposition from the conservative minority government.

To achieve its goal of being a zero net contributor to carbon, Norway will have to purchase so-called carbon offsets abroad.

Offsets are investments in projects that reduce carbon in the atmosphere, such as reforestation or afforestation, or improving energy efficiency or a switch to cleaner power in poor countries.

Climate and Environment Minister Vidar Helgesen, in a letter to parliament, branded the initiative premature and costly, saying the price could be as much as 20 billion kroner (3.2 billion euros) per year in 2030.

The opposition however defended the move.

"Would it be less costly and would the consequences for society be diminished if we postpone this measure?" asked Terje Aasland of the Labour Party.

As western Europe's main oil producer, Norway is a big indirect contributor to heat-trapping fossil fuel gases, but it is also vocal in the fight against climate change.

Its greenhouse gas emissions rose 1.5 percent in 2015 than the previous year, mainly after a new oil field went into operation.

Emissions are now higher than in 1990, a benchmark year in calculating efforts to reduce global-warming gases.

Its electricity is already mostly produced by hydro.

In 2008, Norway had set a date of 2030 for carbon neutrality but said this was dependent on an international climate agreement.

After the failure of the UN's Copenhagen climate summit in 2009, the deadline was pushed back to 2050.

However, the 2015 climate deal reached in Paris reactivated the 2030 objective.

The MPs also voted in favour of a recommendation to ratify the agreement.

Under the so-called COP21 gathering in Paris, 177 governments set a target of limiting global warming to "well below" 2.0 degrees Celsius (3.6 Fahrenheit) compared with pre-industrial levels.

Scientists warn that Earth is on track for much higher and potentially catastrophic warming, and reaching the 2 C target will require unprecedented effort.