The acceptance of the Paris agreement was met with cheers that rang across La Seine, the specially constructed hall for the historic talks.
The voice of the English translator broke with emotion as she relayed the words of the host, French foreign minister Laurent Fabius.
It was followed by laudatory speeches from leaders around the world.
The head of the UN climate change body Christiana Figueres gave a speech that had her staff dancing in the aisles.
But just a few hours before the celebrations, there was a crisis that nearly saw the entire deal unravel agonisingly close to its conclusion.
The sharp-eyed legal advisers in the United States delegation noticed something had changed between the penultimate draft and the final version being presented.
Where the word “should” had been used in all previous drafts, the word “shall” was, for some unknown reason, now in its place.
It was a seemingly small error — but one with enormous implications.
“Should” implies a moral obligation but does not compel a nation to do something. “Shall”, however, means there would be a legal obligation to undertake the action.
If the final text used the word “shall” in the wrong place, it would require the Americans to get congressional approval — something universally acknowledged as impossible.
If it was not changed, the US would never be able to sign on and China would then not sign on to something to which the Americans were not a party.
But it was not a simple matter of fixing the text.
Some nations saw it as a serious change that required re-opening the negotiations.
The Nicaraguans, who are opposed to the deal, saw it as an opportunity to make gains. Suddenly, the deal was falling apart.
It took interventions at the highest level, with both US president Barack Obama and Cuba’s leader Raul Castro making phones calls to the Nicaraguans to get them to back down.
The ABC has been told China played a significant role in lobbying nations to allow the last-minute changes.
The pressure worked. The “shalls” were changed back to “shoulds”, the text was put to the plenary and accepted.
A narrow miss that nearly saw a grammatical error bring down a world-wide agreement.