The years-long quest for a universal pact to avert catastrophic climate change has neared the finish line with a draft agreement completed in Paris.
After nearly two weeks of tough haggling between bureaucrats and ministers from around the world, French and UN officials have completed a line-by-line edit of a historic agreement that seeks to slow global warming and ease its impacts.
"We have a text to present," said an official in the office of Foreign Minister Laurent Fabius, who presides over the 195-nation talks.
After translation into the UN's six official languages, the document was to be handed to ministers last night, nearly 16 hours after the crunch conference was scheduled to close.
It was hoped the text would be adopted at a special session today.
Fabius said on Friday he was "sure" the project would succeed.
"Everything is in place to achieve a universal, ambitious accord," he said.
"Never again will we have a more favourable momentum than in Paris."
World powers have led an overtime push for a deal as sleep-deprived envoys battled in Paris to unlock deep-seated disputes about who must do what to confront climate change.
Many have billed the talks as the last chance to avert worst-case-scenario climate change effects: increasingly severe droughts, floods and storms, as well as rising seas that would engulf islands and populated coasts.
The agreement would seek to revolutionise the world's energy system by cutting back or potentially eliminating coal and other fossil fuels, replacing them with renewable sources such as solar and wind.
The Paris talks have largely been free of the fierce arguments that plagued previous UN climate conferences.
The Chinese delegation's deputy chief Liu Zhenmin said he was "quite confident" a deal would be sealed.
Developing nations insist rich countries must shoulder the lion's share of responsibility for tackling climate change as they have emitted most of the greenhouse gases since the Industrial Revolution. But the United States and other rich nations say emerging giants must also do more.
They argue that developing countries now account for most of today's emissions and thus will be largely responsible for future warming.
One of the deepest disagreements is about funding the climate fight - at a cost of trillions of dollars over the decades to come.
Rich countries promised six years ago in Copenhagen to muster US$100 billion ($148b) a year by 2020 to help developing nations make the energy shift and cope with the effects of global warming.
But how the funds will be raised is unclear, and developing countries demand a commitment to increase the amount after 2020, when the pact enters into force.