Two weeks of hard grind and sleepless nights for the delegates, during which it often seemed progress was elusive, have ended in success at the COP24 Climate summit in Katowice, Poland.
Nearly 200 nations have signed up to the rule book that will underpin the implementation of the 2015 Paris climate accord.
Two years of work were needed ahead of the summit to forge consensus and overcome the many political divisions that threatened the deal.
The 156-page rulebook, split into thematic sections, sets out how countries will measure their progress in reducing carbon emissions, how developing countries should be supported and monitoring mechanisms.
The talks had dragged into an extra day as countries wrangled about a system of carbon credits that allows higher polluting nations to purchase the right to emit more carbon dioxide through funding reduction measures in other countries. However, the details were ultimately agreed shortly before 11pm CET, prompting an ecstatic reaction from the talk's host.
"It has been a long road. We did our best to leave no-one behind." said the chairman of the talks, Polish minister, Michal Kurtyka.
The Paris deal comes into force in 2020, and seeks to limit the rise in global temperatures to below 2 degrees celsius.
However, environmental groups warned that merely securing a mechanism to implement the Paris agreement was an insufficient outcome when scientists are warning that more measures are needed to avoid a global warming catastrophe.
"As the COP24 climate summit comes to an end, it is clear that governments have failed to adequately respond to the catastrophic impacts of climate change," Climate Action Network Europe said in a statement.
The group called on countries to go beyond existing pledges in reducing their own emissions and helping other nations adapt to inevitable changes.