Donald Trump was left isolated at the end of a fractious G20 summit in Hamburg, Germany, after every other world leader signed up to a declaration that the Paris climate agreement was irreversible following an unprecedented standoff.

After the publication of a final communique that saw the emergence of a G19 grouping for the first time, Theresa May said she was “dismayed at the US decision to pull out” of the accord and had personally urged the president to reconsider.

Asked why she had failed to raise the issue during a formal 50-minute bilateral meeting with Trump at the Hamburg Messehallen, as furious negotiations were still going on behind the scenes, the prime minister said: “I did bring the issue of climate change agreement up with President Trump.

“I have had a number of conversations with him while I’ve been here at the G20. What I did was encourage him to bring the United States back into the Paris agreement, and I continue to hope that’s what the United States will do.”

It came after the president promised May that the US was ready to strike a trade deal with the UK as soon as possible after Brexit. “There is no country that could possibly be closer than our countries,” Trump said. “We have been working on a trade deal which will be a very, very big deal – a very powerful deal, great for both countries – and I think we will have that done very, very quickly.”

He added: “Prime Minister May and I have developed a very special relationship and I think trade will be a very big factor between our two countries.”

It came as May used the two-day summit to focus on the possibility of post-Brexit trade opportunities in a series of one-on-one meetings with non EU leaders, including China’s Xi Jinping, India’s Narendra Modi, and Japan’s Shinzo Abe.

“I have held a number of meetings with other world leaders at this summit and have been struck by their strong desire to forge ambitious new trading relationships with the UK after Brexit,” said May. “This is a powerful vote of confidence in British goods, British services, Britain’s economy and the British people – and we look forward to building on these conversations in the months ahead.”

May said she would not be sceptical about the Trump offer but remained “optimistic”.

However, critics were quick to warn against taking Trump at his word. “I think it is political puffery. There will be no fast US-UK trade agreement,” said a former senior official at the IMF and in the Canadian government, who has dealt with the US in a major trade negotiation.

Thomas Bernes, now a fellow at the Centre for International Governance Innovation, said: “I was involved in the Canada-US trade agreement and it was extremely complicated. No one will be interested in a trade deal until you know where the UK is vis-a-vis the European Union and until that point is reached you can have plenty of goodwill but it is nothing more than that.”

Police walk ahead of protesters demonstrating against the G20 summit in Hamburg. Photograph: Morris MacMatzen/Getty Images

He claimed that Trump had failed to understand the complexity of trade agreements, saying the US president would first need to request permission to negotiate from Congress, which would have six months to consider the issue.

The G20 meeting saw a number of tense encounters between Trump and other world leaders, with a particular clash between him and the French delegation over climate change, but also tensions over protectionism and the overproduction of steel.

The final communique said: “We take note of the decision of the United States of America to withdraw from the Paris agreement.” It added: “The leaders of the other G20 members state that the Paris agreement is irreversible.”

However, the US did succeed in forcing in a controversial reference to helping countries access fossil fuels in a clean way – to the fury of environmental campaigners.

Steve Price-Thomas, Oxfam’s director of advocacy and campaigns, said: “With the other 19 members firmly defending the Paris agreement as irreversible, President Trump’s stubborn insistence on propping up the fossil fuel industry leaves him isolated and stuck in the past.” He also accused the G20 of treating the world’s poorest as an afterthought.

The communique placed a new emphasis on the need for trade deals to be reciprocal and non-discriminatory, reducing the previous emphasis on the primacy of liberalisation. At the same time it called for adherence to a rules-based regime and respect for the WTO. It also called for “concrete policy solutions” on excess steel capacity to be prepared by November this year; a speed-up in the previous timetable and a concession to Trump.

On trade, another sticking point during the two-day summit, the leaders agreed they would “fight protectionism including all unfair trade practices and recognise the role of legitimate trade defence instruments in this regard.”