Sleep-deprived negotiators from nearly 200 nations agreed early Sunday morning on the framework for an international climate change pact, salvaging UN talks which went 30 hours into overtime and at moments seemed on the precipice of collapse.
Under the deal, governments will unveil national plans to curb greenhouse gas emissions by next March, as part an agreement to be signed in Paris at the end of 2015.
Diplomats left Lima on a "fresh wave of positivity towards Paris with a range of key decisions agreed and action-agendas launched," said Christiana Figueres, Executive Secretary of the UN's climate change organization.
But critics said the the outcome was weak and woefully inadequate in averting a two degrees Celsius rise in temperature compared to the pre-Industrial Age — a level of warming that many scientists say could bring about dangerous levels of sea-level rise and more frequent, extreme weather events.
After two weeks of haggling over the small print, the draft text was the "lowest common denominator," Tasneem Essop of the World Wildlife Fund told VICE News.
"It's a missed opportunity to come out with something stronger against the emergency we face with climate change," Essop said.
The final text — introduced by Peru's Environment Minister Manuel Pulgar-Vidal and president of the summit — broke days of deadlock by incorporating a series of last minute compromises.
A primary bone of contention was a demand by developing countries that richer nations fairly share the burdens of cutting their emissions and paying for poor countries' transition to cleaner energy sources and preparing for the impacts of a warmer planet.
Developed countries, such as the United States and the European Union, wanted all countries to make emissions cuts as well as lock in official audits of each country's progress on cutting carbon dioxide pollution.
China and India refused, however, arguing that agreeing to cut their emissions too severely would endanger their efforts at reducing poverty.
Though as talks wore into the wee hours of the morning, a linguistic maneuver successfully brought about China's support for the draft text. Negotiators changed the single word "shall" to "may" with respect to each country's obligation to report its levels of achieved emissions cuts.
"The wall between developed and developing nations has been slowly chipping away for years," Jake Schmidt of the National Resources Defence Council, said. "This is a last gasp at keeping that line very clearly divided between the two."
'Much remains to be done in Paris next year.'
It did however raise strong doubts about countries ability to make necessary cuts to hold off temperature rise greater than two degrees Celsius. Little progress was made on addressing rising impacts before the 2020 pact takes effect.
"It's not perfect, but we are satisfied with the Lima outcome," lead Brazil envoy, Antonio Marcondes said.
"Much remains to be done in Paris next year," French Foreign Minister and incoming chair of the UN negotiations Laurent Fabius said.
Developing nations also fought for assurances on funds to cope with the onset of climate change, as well as separate financing for "loss and damage" — funds allocated to nations following extreme weather events, like typhoons or floods.
The framework moved forward the developed world's commitment to put up $100 billion a year from 2020 in financial aid to developing countries.
"The debate on the Lima text is a microcosm of the much bigger debates we're going to have over the next few years," Alden Meyer, a veteran watcher of negotiations at the Union of Concerned Scientists told VICE News.
Leisha Beardmore, spokeswoman for the Seychelles, a low-lying archipelago in the Indian Ocean at risk of rising sea levels, told VICE News that the inclusion of 'loss and damage' was a "bonus", after it was unexpectedly slashed from the text Saturday morning. "As one of the most vulnerable countries," she said, "it's essential we proved we will fight to the end for climate justice."
After over 20 years of failed negotiations — notably in Copenhagen in 2009 — the Lima talks began on an cautiously optimistic note.
Emissions reduction pledges from the European Union, the United States, and China, which account for over half of all global emissions, spurred momentum coming into the talks.
In a historic joint announcement in November, the United States vowed to cut emission by 26 to 28 percent by 2025 on 2005 levels, while China said it would cap emissions "around 2030." For its part, the European Union said it would cut its emission by 40 percent by 2030 compared to 1990 levels.
These pledges came as report after report was released throughout 2014 expressing concerns about the rate of changes to the Earth's climate, bolstering the case for action.
On Thursday, US Secretary of State John Kerry attended the talks, telling negotiators: "science is screaming at us."
Another signature outcome for the summit was the retention of draft proposals to phase out fossil fuels by 2050.
Shifting to low-carbon economies is vital for slashing heat-trapping emissions at some point in the second half of the century, the UN says.
"We're talking about an economic transformation," the World's Bank special envoy for climate change, Rachel Kyte told VICE News. "This was a pollution treaty 20 years ago. Now's it skirting around the edges of how we're managing the global economy. We're inventing global governance."
Follow Alex Pashley on Twitter: @A_Pashley