The summit had been at risk of stalling before the US and the EU leapt a amaze move. Then, after three all-night sessions, decades of failure were reversed and a historic agreement reached

I ensure no objections, said the expressionless French foreign minister Laurent Fabius, barely glancing at the rows of country delegates then sharply banging his gavel. There was a moments silence as if no one could quite believe it, and then the cheers rang out, the tears of relief flowed and in scenes of high emotion, the anonymous meeting hall in a northern suburbium of Paris erupted. Thousands of delegates started to applaud one another. They had done it.

Al Gore embraced UN climate chief Christina Figueres, who clutched UN secretary general Ban Ki-moon, who radiated relief to everyone. Lawyers slapped diplomats on the back, NGOs high-fived security guards, who shook hands with the worlds media, who whistled and cheered.

After more than 20 years of abject failure to agree a new global climate deal, rich and poor countries had agreed to differ and had finally adopted 31 pages of dense, legal text which, only possibly, could set the world on a different, cleaner safer, energy path.

When 150 the heads of state and government pledged two weeks ago in Paris to forge a new climate deal, it seemed certain they would stimulate history where decades of tortuous UN climate talks had failed.

On Saturday night, with protesters gathering in the street of Paris and thousands of legislators, diplomats, lawyers, business leaders, charities and others exhausted from three all-night negotiating sessions, the deal was closed.

For the UN and most governments, what has emerged is nothing less than a universal legal agreement to limit future man-made climate change, the greatest existential threat to life on Earth.

The most complex talks ever engaged in by governments proved successful and an ambitious deal struck to limit temperature rises to 1.5 C. Lord Nicholas Stern, academic and economist at the London School of Economics and author of an influential report on the economics of climate change, had said on Friday, “the futures” bright.

He added: If we get this right, it will be more powerful than the industrial revolution. A green race is going on.

Under the deal put to countries by Fabius on Saturday morning, nations agreed to hold temperature rises well below 2C and endeavour to reach 1.5 C and would individually commit to reduce emissions. There would be regular reviews, $100 bn a year would be mobilised to help poor countries to adapt, carbon markets would be developed, forests protected and renewable energy given the biggest boost it has ever had.

But for many outside the halls, the package being offered was welcome but not nearly enough, because countries could prefer their own targets, would not be legally bound and would not get anything like the money needed. This is progress, but its only a start, said one resulting environmental group.

After the 2009 diplomatic calamity of Copenhagen, when countries could only reach a weak deal, the path to Paris had been well-prepared. China, India and the US, the three largest polluters, all wanted a deal; 186 countries had volunteered to cut emissions; French diplomats had expended a year lobbying every key country; aid packages to help the poorest had been prepared and Barack Obama had gratified Chinese chairwoman Xi Jinping.

Money was always the key to a deal, with big business, global banks and many rich countries lined up to pledge billions of dollars; 450 mayors of the worlds largest cities had agreed to slash emissions and the World Bank and others had said they would increase climate funding by more than $100 bn. But behind the scenes, arguments raged as rich countries locked cornets with big emerging nations such as India, China, Brazil and South Africa over money, legal liability, compensation and how emissions cuts would be verified. Poor countries pressed hard for a 1.5 C temperature rise limit in the text.

But the first two nights political deliberations did not ensure the expected breakthrough and a second text was produced. On Wednesday came the first signs that the talks were stalling and major differences between rich and poor countries were emerging. The US was resisting any legally binding fiscal obligations, the Chinese anything that let rich countries off the financial hook.

On Thursday, the US and the European union played a trump card which they had been secretly preparations for months. Obamas administration, along with the EU, had known the powerful developing economies would oppose them. Rising economies such as China and India defied having to curb their emissions unless they considered even deeper cuts from the US and rich countries.

The way to get a strong deal, they reasoned, was to split the China/ India/ Brazil/ South Africa bloc, known as the Basic group, from the rest of the G77 group of 132 developing countries. The plan involved Tony de Brum, charismatic foreign minister of the Marshall Islands, who was asked to pull together a coalition of high ambition of rich and poor countries that wanted the 1.5 C limit on temperatures.

When, on Friday, the coalition group took the stage, it spanned countries as diverse as Kiribati in the Pacific and Iceland, the US, the EU member states and Angola. It claimed to represent 90 -odd countries, all of which supported the goal of restriction warming to 1.5 C, a long-term target of decarbonising the economy, regular reviews of progress and transparency.

In truth, it was unclear where the coalition received from. Unlike the official blocs at the talks, its members did not negotiate as a group. De Brum, when pressed, could not even articulate how many members were in the coalition.

Negotiators from Bangladesh and small island countries denounced it as a stunt. China called it meaningless. Others said it was a route for rich countries to hide behind the poor, or the power of small countries to transformation large countries stances. But it had a galvanising impact, permitting more than 90 countries to claim the moral high ground and suggesting that anyone who was not with them was unambitious.

In the next few hours, Chile, Switzerland, Iceland, Brazil and Australia joined. The once fanciful ambition of holding temperatures to 1.5 C was now firmly on the UN agenda.

But the major sticking point demonstrated not to be temperature, but the principle enshrined in the original UN climate convention that rich countries, because they had caused the problem, were legally obliged to cut emissions more than poor countries and help them adapt. Even on Friday night, China, India and others were saying a deal was not certain unless it contained differentiation in every area.

It has been a paradigm battle, said Meena Rahman of Third World Network. The US has been telling the developing countries that we all have some responsibility, and therefore we should share the effort. Developing countries say the rich have been rewriting the rules. The world hasnt changed and “they il be” escaping. Developing countries will stimulate our contribution, but it must be according to what we can do.

Other observers said the talks had always been slanted against poor countries, with US corporate muscle defining the agenda and building it hard for poor countries to negotiate other than under extreme pressure near the end of the summit, when their meagre resources would disadvantage them.

It is just like apartheid, Nozipho Joyce Mxakato-Diseko, South African leader of the G77 group of 132 poor countries, complained bitterly in October. We find ourselves in a position where, in essence, we are disenfranchised.

Asad Rahman of Friends of the Earth added: We had a string of unbalanced texts and drafts before Paris. The result was that we reached a place at the end of the first week where we should have been nearly a year ago, so this week there have had to be trade-offs. It was the deliberate engineering of a vehicle accident so a deal was never going to be sufficient or fair.

The second great combat erupted in the early hours of Friday morning, when the blocs led by Saudi Arabia and Venezuela began to push back against the draft released by the French.

Saudi Arabia demanded that negotiators strike any reference to a temperature aim below 2C, while China objected to the idea of five-year its further consideration of emissions targets. Russia said the 1.5 C limit was not supported by science. Bolivia demanded emissions be cut in line with each countrys historic responsibility for climate change.

It appeared disastrous when US secretary of state John Kerry took the microphone, telling the draft used to go as far as it could on the question of differentiation. If we go any further, the whole agreement will be destroyed, he warned, according to delegates accounts.

By Saturday morning, the French presidency was shuttling between country groups in a frantic search for compromises. At 5.30 am, it started to draw up a take-it-or-leave-it deal which meant all countries would have to abandon some red lines. No country would get all it wanted, but no country would lose all. It appeared to be the world moving in roughly the same direction.

Read more: