The UN climate change summit has finally produced a milestone agreement to reduce the industrial world's greenhouse gas emissions - but not before it looked like collapsing in a virtual shambles.
The deal was adopted long after dawn today, after delegates representing 164 countries had spent all night discussing it paragraph by paragraph. But it was principally brokered in earlier tripartite talks involving the European Union, Japan and the US. An hour before the conference was due to end, the EU delegation met in emergency session on foot of alarming indications that the US was considering its position after one of its key conditions - "voluntary participation" by developing countries - had been dropped from the text.
According to reliable sources, one woman member of the delegation who had worked particularly hard over the past 10 days broke down and others were on the verge of tears when it seemed as if the whole climate change negotiating process was about to be plunged into chaos.
At the time, the US delegation - furious at the exemption for the developing world - was in direct contact with the White House seeking instructions on what to do. But it would appear that President Clinton told his negotiating team to stand by the targets they had already agreed.
What it means in terms of green-house gas emissions is an 8 per cent cut by the EU, 7 per cent by the US and 6 per cent by Japan - all within a tolerably narrow band, as the EU had insisted. The EU's initial offer was 15 per cent, while the US had come to the conference effectively offering zero.
All three figures represent reductions on 1990 levels to be achieved in the years 2008 to 2012. Other countries regarded as "special cases", such as Australia and Norway, have been permitted increases - but without compromising the 6 per cent cut for the industrialised world.
However, this was seen by environmentalists as a "soft target". They pointed to the fact that an earlier draft had said the industrialised countries "shall reduce" their emissions by this figure, whereas the revised text had the more nebulous phrase "with a view to reducing" emissions. Bleary-eyed delegates had talked through the night in an effort to reach agreement in a game of "global chicken" between the rich industrialised nations and the developing countries to see which side would blink first or risk taking the blame if the Kyoto climate change summit ended in failure.
Perhaps not surprisingly, after going on almost non-stop for two days and nights, some of the delegates at the final plenary session were actually asleep in their seats. But amid the chaos of the final session the deal was being hailed by many of the participants as a "great day for the global environment"
Some were even ecstatic. Mr Michael Grubb, head of energy and environment at the Royal Institute of International Affairs in London, said: "21st century historians will look back at this conference as one of the three greats - Versailles, Bretton Woods and Kyoto."
Mr John Prescott, the British Deputy Prime Minister and one of the chief negotiators, said it had been "one hell of a process" in which the EU had played a major role. When it looked near collapse, he himself had been in touch with the US vice-president, Mr Al Gore.
Several contentious issues, such as "emissions trading", have been left to be worked out between now and the next climate change in Buenos Aires in November 1998. This will provide a "window of credibility" to build more confidence between the industrialised countries and the developing world.