World leaders reached a compromise on trade at the Group of 20 summit as officials agreed to fight protectionism while tacitly recognising US President Donald Trump’s concerns about excess steel capacity and what he says are unfair trade practices.

Hours after the agreement was struck early on Saturday, the final statement nonetheless left the US isolated on climate change, according to officials from three G20 countries. At the same time, the statement refers to the use of “trade defence instruments,” leaving the shadow of tariffs hanging over the world.

Talks ran into a major rift over global economic policy on Friday as Trump, who spent much of his election campaign complaining about “unfair” trade hurting the US, held firm to his America First doctrine. G20 officials are concerned about a trade war over steel as Trump gears up for a decision on whether to impose punitive tariffs amid ongoing complaints about dumping on global markets.

German Chancellor Angela Merkel, the summit’s host, said on Friday that leaders need to find a common solution to steel overproduction, otherwise the risk of “bilateral actions” increases. In its communique, the G20 pledged renewed efforts to combat excess capacity in the steel industry, according to a leaked copy of the text.

“We will keep markets open, noting the importance of reciprocal and mutually advantageous trade and investment frameworks,” according to the draft statement. The G20 will “continue to fight protectionism including all unfair trade practices and recognize the rule of legitimate trade defense instruments in this regard.”

Trump’s administration is weighing whether to impose tariffs, quotas or a combination of both on steel imports under national security grounds through Section 232 of the Trade Expansion Act, even though only a fraction of US steel is used for defence. Trump’s Commerce Department launched its review in April, missed a self-imposed deadline for a decision last month and is expected to announce a verdict soon.

“We stand united in opposition to protectionism, that I think will be a positive outcome from this meeting,” Canadian Finance Minister Bill Morneau told reporters in Hamburg. “What I believe to be the case is we all recognise the importance of trade to our economies, the importance of trade to growth, and the difficulties protectionism presents. That’s a subject that has reached consensus.”

The final statement underlined Trump’s lone stand on climate change, saying that all G20 members except for the US “state that the Paris Agreement is irreversible,” according to several officials.

In the statement, the US announced that “it will immediately cease the implementation of its current nationally-determined contribution and affirms its strong commitment to an approach that lowers emissions while supporting economic growth and improving energy security needs.”

The first day of the two-day summit was marred by disagreement on free trade and climate change as Trump’s protectionist stance was blamed by other participants for causing an impasse. During a working lunch, Trump stressed that he would always defend the American worker, according to a western diplomatic official familiar with the closed-door session.

French President Emmanuel Macron challenged Trump’s view that the US is losing out on trade, the official said. Taking out his mobile phone, Macron said that when he bought it, he created a trade deficit with the US, but that when America built it, it created a trade deficit with China. His point was that it doesn’t make sense to talk about bilateral trade deficits in a multilateral world, the official said.

The exchange illustrates the world’s struggle to come to terms with the Trump era and his administration’s determination to remould the post-war global consensus in favour of the US. The last major summit, of G-7 leaders in May, ended with the US isolated on climate change.

Saturday’s sessions were dedicated to tackling migration and a “partnership with Africa,” digitalisation, empowering women and employment.