Negotiators in Poland have finally secured agreement on a range of measures that will make the Paris climate pact operational in 2020.
Last-minute rows over carbon markets threatened to derail the meeting – and delayed it by a day.
Delegates believe the new rules will ensure that countries keep their promises to cut carbon.
The Katowice agreement aims to deliver the Paris goals of limiting global temperature rises to well below 2C.
“Putting together the Paris agreement work programme is a big responsibility,” said the chairman of the talks, known as COP24, Michal Kurtyka.
“It has been a long road. We did our best to leave no-one behind.”
Rich nations often reduce emissions by paying for carbon-cutting projects in other countries. But these programmes are very difficult to police.
Fraud and double accounting have rendered many of them worthless – they are often dubbed hot air schemes.
The common rulebook envisages flexibility for poorer nations.
Developing countries seek recognition and compensation for the impact of rising temperatures.
The idea of being legally liable for causing climate change has long been rejected by richer nations, who fear huge bills well into the future.
Last weekend, scientists and delegates were shocked when the US, Saudi Arabia, Russia and Kuwait objected to the meeting “welcoming” a recent UN report on keeping global temperature rise to within the 1.5C limit.
The report said the world is now completely off track, heading more towards 3C this century.
Keeping to the preferred goal would need “rapid, far-reaching and unprecedented changes in all aspects of society”.
What did the delegates focus on?
Representatives from 196 states took part in the talks. They were trying to sort out some very tricky questions about the rulebook of the Paris agreement.
These are the regulations that will govern the nuts and bolts of how countries cut carbon, provide finance to poorer nations and ensure that everyone is doing what they say they are doing.
It sounds easy but is very technical. Countries often have different definitions and timetables for their carbon cutting actions.
Poorer countries want some “flexibility” in the rules so that they are not overwhelmed with regulations that they don’t have the capacity to put into practice.
Is this enough?
Laurence Tubiana, a key architect of the Paris agreement, and now with the European Climate Foundation, said the agreement was a big boost for the Paris pact.
“The key piece was having a good transparency system because it builds trust between countries and because we can measure what is being done and it is precise enough,” she told BBC News on the sidelines of this meeting.
“I am happy with that. Nobody can say that’s not clear, we don’t know what to do, or that it’s not true anymore. It’s very clear,”
She said that countries like Russia which had refused to ratify the Paris agreement because it wasn’t sure about the rules, could no longer use that excuse.
However some observers say the deal is not sufficiently strong to deal with the urgency of the climate problem.
In the words of one delegate, “it’s what’s possible, but not what’s necessary”.
What about cutting carbon faster?
There has been a big push for countries to up their ambition, to cut carbon deeper and with greater urgency.
Many delegates want to see a rapid increase in ambition before 2020 to keep the chances of staying under 1.5C alive.
Right now, the plans that countries lodged as part of the Paris agreement don’t get anywhere near that, described as “grossly insufficient” by one delegate from a climate vulnerable country.
Business is also looking for a signal from this meeting about the future.
“Companies are ready to invest and banks are ready to finance,” said Carlos Salle from Spanish energy conglomerate, Iberdrola.
“So we need that greater ambition in the policy to enable business to move further and faster.”