ARTICLE AD BOX
The COP29 climate talks have reached a last ditch deal on cash for developing countries, pulling the summit back from the brink of collapse after a group of countries stormed out of a negotiating room earlier.
The slew of deals finally signed off in the small hours of Sunday morning in Azerbaijan includes one that proved hardest of all - one about money.
Eventually the more than 190 countries in Baku agreed a target for richer polluting countries such as the UK, EU and Japan to drum up $300bn a year by 2035 to help poorer nations both curb and adapt to climate change.
It is a far cry from the $1.3trn experts say is needed, and from the $500bn that vulnerable countries like Uganda had said they would be willing to accept.
But in the end they were forced to, knowing they could not afford to live without it, nor wait until next year to try again, when a Donald Trump presidency would make things even harder.
Bolivia's lead negotiator Diego Pacheco called it an "insult", while the Marshall Islands' Tina Stege said it was "not nearly enough, but it's a start".
UN climate chief Simon Stiell said: "This new finance goal is an insurance policy for humanity, amid worsening climate impacts hitting every country.
"No country got everything they wanted, and we leave Baku with a mountain of work still to do. So this is no time for victory laps."
The funding deal was clinched more than 24 hours into overtime, and against what felt like all the odds.
The talks were rocked from the start by the incoming presidency of climate denier Mr Trump, the moment Argentina's team were recalled back to Buenos Aires by their right-wing president and a controversial letter that sent shockwaves through the United Nations.
The fraught two weeks of negotiations pitted the anger of developing countries who are footing the bill for more dangerous weather that they did little to cause, against the tight public finances of rich countries.
A relieved Juan Carlos Monterrey Gomez, climate envoy for Panama, said there is "light at the end of the tunnel".
Just hours ago, the talks almost fell apart as furious vulnerable nations stormed out of negotiations in frustration over that elusive funding goal.
They were also angry with oil and gas producing countries, who stood accused of trying to dilute aspects of the deal on cutting fossil fuels.
Please use Chrome browser for a more accessible video player
The UN talks work on consensus, meaning everyone has to agree for a deal to fly.
A row over how to follow up on last year's pledge to "transition away from fossil fuels" was left unresolved and punted into next year, following objections from Chile and Switzerland for being too weak.
A draft deal simply "reaffirmed" the commitment but did not dial up the pressure in the way the UK, EU, island states and many others here wanted.
Saudi Arabia fought the hardest against any step forward on cutting fossil fuels, the primary cause of climate change that is intensifying floods, drought and fires around the world.
Governments did manage to strike a deal on carbon markets at COP29, which has been 10 years in the making and will allow countries to trade emissions cuts.
'Not everything we wanted'
The UK's energy secretary, Ed Miliband, said the deal is "not everything we or others wanted", but described it as a "step forward".
"It's a deal that will drive forward the clean energy transition, which is essential for jobs and growth in Britain and for protecting us all against the worsening climate crisis," he added.
"Today's agreement sends the signal that the clean energy transition is unstoppable.
"It is the biggest economic opportunity of the 21st century and through our championing of it we can help crowd in private investment."
Read more:
Azerbaijan president hails oil and gas as 'gift from God'
UN climate summits 'no longer fit for purpose'
The Azerbaijan team leading COP29 said: "Every hour of the day, we have pulled people together. Every inch of the way, we have pushed for the highest common denominator.
"We have faced geopolitical headwinds and made every effort to be an honest broker for all sides."