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 exstatic 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 celcius.