Deadlock over climate change between the US and the other nations at the G20 summit appears to have been broken.
The BBC understands a compromise final closing text has been agreed at the second day of their meeting in Hamburg.
According to an EU official, the text acknowledges President Donald Trump’s withdrawal from the Paris climate agreement without undermining the commitment of other countries.
It comes after a second night of violent protests in Hamburg.
Negotiators worked through the night in an attempt to reach a compromise on the wording of the summit statement.
- Who are the G20 protesters?
- Watch: Battles between police and protesters
- In pictures: Violence at G20 protests
- How much do world leaders earn?
Meanwhile leaders have held separate talks. President Donald Trump met British PM Theresa May, and said a US-UK trade deal would be signed soon.
The host, German Chancellor Angela Merkel, held a working breakfast with Presidents Putin of Russia and Macron of France. On Friday had described the first day of talks as “very difficult”.
But early on Saturday, an EU official told Reuters news agency: “The outcome is good. We have a communiqué. There is just one outstanding issue on climate.” He added that the statement included a pledge to “fight protectionism”.
Mr Trump, after his morning meeting with Ms May, said he expected a “very powerful” trade deal between the two countries “very quickly”.
The G20 (Group of Twenty) is a summit for 19 countries, both developed and developing, plus the EU.
A text that can be tolerated – by James Robbins, BBC Diplomatic Correspondent
For many hours, draft versions of the summit conclusions were causing deep concern to most G20 members. On climate change, it was effectively a G19 plus the United States.
Part of the final text will apparently recognise Donald Trump’s rejection of the global Paris agreement to limit rising temperatures. But language the US was insisting on, which seemed to endorse the use of coal and oil long into the future, has now apparently reached a form others can tolerate, because they are not directly associated with it.
While this deadlock has apparently been resolved, it reflects a very divisive summit in which the rest of the world has been struggling to come to terms with the US president’s “America first” policy: his suspicion or rejection of the whole concept of worldwide agreements designed to encourage free trade as well as collective action against global warming.
Why the angry protests in Hamburg?
There have been large protests on the streets of Hamburg, with demonstrators and armed police clashing into the early hours of Saturday.
Demonstrators – who were protesting against the presence of Mr Trump and Mr Putin, climate change and global wealth inequalities – set fire to vehicles and barricades, threw rocks at officers and looted shops.
At one point, police chased protesters across rooftops while officers on the streets used water cannon on protesters.
Nearly 200 police officers were injured during the protests. Dozens of protesters have been detained.
What happened when Trump met Putin?
On Friday, Mr Trump used his first meeting with Russian President Vladimir Putin on the sidelines of the G20 to discuss the alleged Russian hacking of last year’s US presidential election.
Both sides called the meeting positive – but differed in their descriptions of the hacking discussion.
Russian Foreign Minister Sergei Lavrov said “President Trump said he heard clear statements… that Russian authorities did not intervene [in the US election], and he accepted these declarations.”
However, US Secretary of State Rex Tillerson said Mr Trump “opened the meeting with President Putin by raising the concerns of the American people regarding Russian interference in the 2016 election.
“They had a very robust and lengthy exchange on the subject. The president pressed President Putin on more than one occasion regarding Russian involvement.”
He said it was not clear whether the two countries would ever come to an agreement on what happened.
Other topics discussed during their meeting included the war in Syria, terrorism and cybersecurity.