The longest United Nations climate talks on record have finally ended in Madrid with a compromise deal.
Exhausted delegates reached agreement on the key question of increasing the global response to curbing carbon.
All countries will need to put new climate pledges on the table by the time of the next major conference in Glasgow next year.
Divisions over other questions - including carbon markets - were delayed until the next gathering.
What was agreed?
After two extra days and nights of negotiations, delegates finally agreed a deal that will see new, improved carbon cutting plans on the table by the time of the Glasgow conference next year.
All parties will need to address the gap between what the science says is necessary to avoid dangerous climate change, and the current state of play which would see the world go past this threshold in the 2030s.
Supported by the European Union and small island states, the push for higher ambition was opposed by a range of countries including the US, Brazil, India and China.
However a compromise was agreed with the richer nations having to show that they have kept their promises on climate change in the years before 2020.
What is the reaction?
UN Secretary General Antonio Guterres said he was disappointed by the result.
"The international community lost an important opportunity to show increased ambition on mitigation, adaptation and finance to tackle the climate crisis," he said, quoted by AFP.
'Never have I seen such a disconnect'
Meanwhile, Laurence Tubiana from the European Climate Foundation, and an architect of the Paris agreement, described the result as "really a mixed bag, and a far cry from what science tells us is needed."
"Major players who needed to deliver in Madrid did not live up to expectations, but thanks to a progressive alliance of small island states, European, African and Latin American countries, we obtained the best possible outcome, against the will of big polluters."
Decisions on other issues including the thorny question of carbon markets have been delayed until Glasgow.
This aspect of the deal was welcomed by campaigners.
"Thankfully the weak rules on a market based mechanism, promoted by Brazil and Australia, that would have undermined efforts to reduce emissions has been shelved and the fight on that can continue next year at COP26 in Glasgow," said Mohamed Adow, with the group Power Shift Africa.
Many of those in attendance were unhappy with the overall package, feeling it did not reflect the urgency of the science.
Spain's acting Minister for the Ecological Transition Teresa Ribera said the mandate was clear.
"Countries have to present more ambitious NDCs [nationally determined contributions] in 2020 than what we have today because it is important to address science and the demands of people, as well as commit ourselves to do more and faster."
However, negotiators will be satisfied to have kept the process alive after these difficult and complex talks in Madrid.
What is the evidence for global warming?
The world is now nearly one degree Celsius warmer than it was before widespread industrialisation, according to the World Meteorological Organization (WMO).
The 20 warmest years on record have all occurred in the past 22 years, with the years from 2015-2018 making up the top four.
The WMO says that if the current warming trend continues, temperatures could rise by 3-5C by the end of this century.
A threshold of 2C had long been regarded as the gateway to dangerous warming. More recently, scientists and policy makers have argued that keeping temperature rise to within 1.5C is a safer limit for the world.
But an IPCC report in 2018 suggested that keeping to the 1.5C target would require "rapid, far-reaching and unprecedented changes in all aspects of society".
How will climate change affect us?
There are varying degrees of uncertainty about the scale of potential impacts.
But the changes could drive freshwater shortages, bring sweeping changes to our ability to produce food, and increase the number of deaths from floods, storms, heat waves and droughts.
Even if we cut greenhouse gas emissions dramatically now, scientists say the effects will continue because parts of the climate system, particularly large bodies of water and ice, can take hundreds of years to respond to changes in temperature.
It also takes greenhouse gases decades to be removed from the atmosphere.