Hours after the applause and relief that the world had finally reached a landmark climate agreement in Dubai, US special envoy John Kerry admitted that he thought it might never happen.
The seasoned international negotiator recalled a conversation with one minister who worried about a deal that would signal the end of fossil fuels.
"One minister from one of those countries involved said, 'John, you can't ask us to commit economic suicide'," Kerry said.
He did not name the country but Saudi Arabia, the world's top oil exporter, led the charge against any strong language against fossil fuels. Kuwait and Iraq were also staunch opponents.
In the end, nearly 200 countries adopted on Wednesday a deal stating that the world will be "transitioning away from fossil fuels" in order to achieve net-zero emissions by 2050.
It was the first time in the 28-year history of the Conference of the Parties that all fossil fuels were mentioned in an accord.
"I never thought we were going to have the kind of breadth that we have today, to be honest with you," Kerry said on Wednesday.
He is not alone.
"It was unhoped for," said a European negotiator.
Another European negotiator said the Emirati hosts were under heavy pressure from both their "big brother" -- Saudi Arabia -- and, "on the other side", from the EU and islands most vulnerable to extreme weather.
The clash centred around the word "phase-out" -- pushed by an unprecedented alliance of countries and hated by oil producers.
After several sleepless nights of negotiations and heavy edits, a middle ground was found: "transitioning away".
An adviser to COP28 president Sultan Al Jaber said the text was "finely calibrated": it was "not perfect" for both the major oil producers or the island states.
Despite having to give up on the word "phase-out", a self-styled "ambitious" alliance of countries still felt they achieved something unimaginable just a year ago.
The eclectic alliance, ranging from European nations to Canada, Colombia, Chile and Kenya, had started COP28 on the right foot by setting aside their differences over another issue on the very first day of the summit.
In record time, on November 30, COP28 launched a "loss and damage" fund that will cover the cost of climate catastrophes in vulnerable countries.
With that "thorny" issue out of the way, the coalition of more than 100 countries stuck together to lead the charge on fossil fuels.
When Jaber proposed on Monday a draft deal that merely suggested that nations "could" reduce fossil fuel production and consumption, the coalition kept up the pressure.
Meeting with Jaber, they raised the spectre of ending COP28 with no deal.
Jaber went back to the drawing board, but "transitioning away" was not his brainchild.
Similar language was used in November in a deal between Australia and Pacific islands that called for a transition away from oil, gas and coal in line with global efforts to limit warming to 1.5 degrees Celsius.
The term "transition" came back during Monday night's crisis in Dubai when it was used by Australia and Norway, two major fossil fuel producers.
"In my opinion phase out is a campaign term and transitioning is more international public policy. We heard more and more people mention it in the last few hours," UAE negotiator Hana AlHashimi told AFP on Thursday.
No consensus would have been possible without the approval of China and the United States, who between them account for 41 percent of greenhouse gas emissions.
Kerry had met with Chinese climate envoy Xie Zhenhua before COP28, setting the stage for close collaboration during the two-week summit in the Emirates.
In November, the two sides issued a joint statement in California which called for speeding up the rollout of renewable energy in order to "accelerate the substitution for coal, oil and gas generation".
Mindful to not rattle its fragile partnership with China, the United States let the "ambitious" nations lead the phase-out fight.
The US delegation showed little enthusiasm at first, a European negotiator said. But Kerry eventually made impassioned speeches for their cause.
The key US contribution was securing China's backing, the negotiator said.
"Keeping China on board is in itself a remarkable achievement," he said.
Credit was also given to the Emirati hosts, who had worked on the massive summit for a year and faced doubts from climate campaigners that an oil-rich nation could deliver a satisfactory deal.
Those doubts were reinforced when Jaber, who heads national oil company ADNOC, was named as president of COP28 in January 2022.
He did not help his cause early on by insisting on talking about reducing "emissions" instead of fossil fuels.
Jaber changed his tune in June, when he started saying that a "phase-down" of fossil fuels was "inevitable".
Over the last month alone, the Emirati negotiating team carried out more than 40 consultations.
"The UAE behaved remarkably with inclusivity in the whole process," Cuban diplomat Pedro Luis Pedroso, who chaired the influential G77+China group, which represents 134 developing countries, told AFP.
"To be honest I don't think they came to this COP with a preconceived text at all," he said.