The Group of 20 leaders departed Hamburg on Saturday unable to paper over the cracks on climate change or sideline fears of a looming trade war on steel.

After two days of talks, leaders of the world’s largest economies reiterated their commitment to free trade – seen as a victory over the Trump administration’s “America First” protectionist policy.

But, five weeks after the US withdrew from the Paris agreement, Chancellor Angela Merkel admitted the meeting ended with “19 against 1” on climate protection. And leaders agreed to what Dr Merkel conceded was an “ambitious” timetable to resolve a growing trade dispute on steel, amid US threats of unilateral action against China.

“We can achieve more together than by acting alone and this was the spirit that guided us in working through our agenda,” said Chancellor Angela Merkel of agreement among leaders representing two thirds of the world’s population.

Despite its flaws the German leader made the most of the deal, anxious to demonstrate her prowess on the world stage ahead of her fourth-term election bid in September.

But she made no bones about the compromises and outstanding disagreements left in the summit communique after two rounds of all-night talks.

Dissent

At noon on Saturday her negotiators gave up hope of finding common ground on climate concerns and, in a G20 first, built in the dissent to the conclusions. The US insisted – to annoyance of other delegations, particularly France – on a line that pushing for lower carbon dioxide emissions must not undermine economic growth or energy security. The US, the communiqué adds, will aid other countries with “use of fossil fuels more cleanly and efficiently”.

German chancellor Angela Merkel thanks members of German law enforcement and emergency services at the conclusion of the G20 summit in Hamburg. Photograph: Sean Gallup/EPA

In a separate statement, other delegations “take note” note of the US withdrawal from the Paris agreement. But the other 19 participants described the deal as “irreversible”,and reiterated their determination to move “swiftly” to full implementation.

Despite their lack of sleep, chief negotiators of some G20 countries were philosophical at the climate compromise deal. Despite the dissent with Washington, they noted an interest from the Trump team in a wording that kept a “back-door open” for Washington to the Paris agreement.

While Dr Merkel said she didn’t share that optimism “at this time”, French president Emmanuel Macron agreed with some negotiators’ cautious optimism.

He said he remained hopeful that Washington would come around, describing this optimism as his “duty, given my position, and it is a trait of my character”.

The French president announced plans for a new climate conference in Paris next December.

The summit concluded with a muddy compromise on another issue of dissent: a growing trade standoff on steel. Unable to resolve the issue fully, leaders kicked the can down then road – though it remains unclear how far.

G20 leaders demanded that a body they set up last year to examine a global steel surplus present data by next month, and “concrete policy solutions” by November.

Sabre-rattling

It remains to be seen what happens then, given US sabre-rattling on a glut of Chinese steel, but officials of other delegations were happy they had continued to bind the Trump administration to the pillars of rules-based global trade.

The final communiqué says G20 countries “strive to reduce global imbalances” and notes the importance of “reciprocal and mutually advantageous trade and investment frameworks”.

In addition members vow to “fight protectionism” but recognised the role of “legitimate trade instruments”.

British prime minister Theresa May adopted a middle position on trade between the US and other G20 members, insisting that London stood by the status quo now and into the Brexit future. Photograph: Friedemann Vogel/EPA

British prime minister Theresa May adopted a middle position on trade between the US and other G20 members, insisting that London stood by the status quo now and into the Brexit future but wanted reform of the World Trade Organisation.

“We want multi-lateral, rules-based framework but we want that it is working effectively,” she said, adding she had pressed other leaders to eliminate “safe space for terrorist financing” around the world.

She still had no date for Mr Trump’s visit to London but said she was confident she would be the prime minister to welcome him.

After meeting British prime minister Theresa May on Saturday, Mr Trump said they were working on a “very, very big deal, very powerful, great (trade) deal for both countries”.

“Tremendous” was how Mr Trump described his first meeting on Friday with Russian president Vladimir Putin, which ran four times longer than the 30 minutes scheduled. Russian president Vladimir Putin said he was impressed by his first meeting with Mr Trump on Friday, saying the man he met in Hamburg was very different from the reality television figure.

He felt Mr Trump accepted his assertions that Moscow had not interfered in the US presidential election last year, before adding it would be best to ask Mr Trump for his views.

Loan programme

Also in Hamburg the World Bank launched a loan programme aimed at empowering women entrepreneurs with $325 million in funding from six G20 member states – including US, Germany, and Saudi Arabia to be matched by private capital.

“This is not a cute little project,” said Mr Jim Yong Kim, the World Bank president. “It is going to be a major driver of economic growth . . . and drive gender equality at the same time.”

Ivanka Trump, attended the G20 summit and attracted considerable attention for sitting in for her father in sessions while he held bilateral talks. Photograph: Sean Gallup/Getty Images

The plan was initiated by Ivanka Trump, who attended the G20 summit and attracted considerable attention for sitting in for her father in sessions while he held bilateral talks.

After months of build-up, and turbulent preparation with Washington, departing German officials expressed satisfaction. They had avoided open confrontation – or worse – with the US, kept it on board on free trade – for now at least – and ensured the rest of the world’s 20 leading economies did not follow Mr Trump to the Paris climate exit.

“The bottom line with the Trump administration after Hamburg,” one senior European official said, “is that we are moving in small steps towards a certain normality.”

After a second night of riots in Hamburg, Chancellor Angela Merkel condemned in the “harshest terms possible” what she called the “untrammelled violence an uninhibited brutality” on display on Friday night in Hamburg.

She thanked police for their service and announced compensation plans to those whose who suffered material losses in the clashes between police and so-called “black block” extremists.

“There is no justification at all for plundering and brutal attacks on police,” she said. “Those who act in that way place themselves outside the democratic community.”