The world has finally struck a climate change deal to limit global warming to less than 2°C.
The agreement, which is partly legally binding and partly voluntary, is the first to commit all countries to cut carbon emissions.
It was reached after 13 days of negotiations - including some sleepless nights - between nearly 200 countries in Paris.
All have agreed to submit and review plans to slash emissions every five years in an attempt to meet an aspirational goal of limiting global warming to 1.5°C.
The key moment came when the chairman of the talks, Laurent Fabius, banged his gavel to mark the adoption of the deal. Delegates then rose their feet cheering and applauding.
In a statement, New Zealand Climate Change Issues Minister Tim Groser called the agreement a "huge and historic step forward".
The significance of so many countries pledging to cut emissions should not be underestimated, he said - and, while it would not solve global warming in one hit, the five-yearly updates would set the world on a "clear pathway to a lower-carbon future".
He said New Zealand's target of reducing emissions to below 30 percent below 2005 levels by 2030 was a strong contribution to the global effort.
Green Party co-leader James Shaw, who is in Paris, said the deal was an incredible achievement.
"It is an historic moment. The atmosphere in the plenary hall was completely electric. Getting 196 countries - every country in the world - to agree on anything, let alone a challenge as great as this one, is unprecedented."
Labour climate change spokeperson Megan Woods, who is also in Paris, said the lower temperature target was a real win for small island states.
"I think it shows that the small island states have worked really carefully and really hard, and really come here and genuinely talked about what climate change means for them."
The government had not met the emission reduction targets it had so far set and this needed to change, she said.
"We can no longer get by on a wish and a prayer. We must get proper planning such as carbon budgeting in place or we face huge financial risk."
The text that has been agreed accepts that the dangers of climate change are much greater than previously acknowledged and pledges to attempt to curb the emissions.
The measures in the final draft, released overnight, included:
The final draft also included provisions for carbon trading but left much of the detail to be worked out at future meetings of the UN climate change body.
As well as the five-yearly reviews of progress, starting from 2023, it included a request for countries to revisit their emission reduction targets in 2018.
The mechanism to help address the damage that poorer, less developed countries might suffer as a result of climate change came with a proviso it did not involve or provide a basis for any liability or compensation.
The US had feared developed countries could be made liable for historical emissions.
Earlier, key blocs, including the G77 group of developing countries, and nations such as China and India said they supported the proposals.
French President Francois Hollande called the proposals unprecedented, while UN Secretary-General Ban Ki-moon called on negotiators to "finish the job".
The deal will not on its own achieve all that environmentalists, scientists and some countries had hoped for.
The average global temperature has already risen by about 1°C since the start of the industrial age two centuries ago and, to cap it at 2°C, carbon dioxide emissions would have to drop to zero between 2060 and 2075.
American secretary of state John Kerry told the conference that would be the job of scientists and business executives.
"It won't be governments that actually make the decision, or find the product, the new technology.
"It will be business unleashed because of 196 nations saying in one loud voice 'we need to move in this direction', and that will move investment that will create new and greater research and development."
- RNZ / BBC