A marathon UN climate conference on Sunday approved a roadmap toward an accord that for the first time will bring all major greenhouse gas emitters under a single legal roof.
If approved as scheduled in 2015, the pact will be operational from 2020 and become the prime weapon in the fight against climate change.
However, Greenpeace lamented the deal as a victory for polluters over people.
It was reached after nearly 14 days of talks under the UN Framework Convention on Climate Change (UNFCCC).
The forum also launched a “Green Climate Fund” to help channel up to US$100 billion a year in aid to poor, vulnerable countries by 2020, an initiative born under the 2009 Copenhagen Summit.
“I believe that what we have achieved in Durban will play a central role in saving tomorrow, today,” said South African Foreign Minister Maite Nkoana-Mashabane, who chaired the talks.
Approval came after two-and-a-half days of round-the-clock wrangling among 194 nations.
The talks should have ended on Friday, but wrapped up in the dawn light of Sunday amid scenes of exhaustion and shredded nerves.
And the often-stormy exchanges reflected concerns among many countries over the cost of making energy efficiencies and switching to clean renewable sources at a time of belt-tightening.
UNFCCC chief Christiana Figueres was exultant.
Citing the words of former South African president Nelson Mandela, she said on Twitter: “In honour of Mandela: It always seems impossible until it is done. And it is done!”
“I think in the end it ended up quite well,” US chief negotiator Todd Stern said. “The first time you will see developing countries agreeing, essentially, to be bound by a legal agreement.”
The EU hailed the outcome as a “historic breakthrough.”
“Where the  Kyoto [Protocol] divides the world into two categories, we will now get a system that reflects the reality of today’s mutually interdependent world,” European Commissioner for Climate Action Connie Hedegaard said in the statement.
UN Secretary-General Ban Ki-moon hailed what he called the “significant” breakthrough that “will guide global efforts to address the causes and impacts of climate change.”
However, the environmental group Greenpeace said the deal was too porous and could spell climate disaster.
“The grim news is that the blockers led by the US have succeeded in inserting a vital get-out clause that could easily prevent the next big climate deal being legally binding. If that loophole is exploited it could be a disaster,” Greenpeace director Kumi Naidoo said.
In the run-up to the conference, scientists pounded out loud warnings, saying future generations would pay the bill for foot-dragging. Current measures to tackle carbon emissions are falling far short of the goal of limiting warming to 2?C.