HAMBURG — The world's wealthiest nations reached a near-unanimous agreement Saturday that the Paris climate agreement is "irreversible," signing on to a document that urges the developed world to move "swiftly toward its full implementation."

All of them, that is, except the United States.

The lack of agreement was widely expected, given President Trump's decision last month to withdraw from the international climate agreement negotiated and signed under President Obama.

But the final communique of the G-20 summit in Hamburg on Saturday showed that Trump and the rest of the world were unable to find a way to accommodate his insistence that the United States is free to renege on agreements made by the previous administration.

The deal calls on each member nation to meet self-defined targets to reduce carbon emissions, with a goal of keeping the average increase in global temperatures under 2 degrees Celsius from pre-industrial levels.

"We take note of the decision of the United States of America to withdraw from the Paris Agreement," the communique read. "The leaders of the other G-20 members state that the Paris Agreement is irreversible."

More G-20 coverage:

Putin says Trump satisfied with denials of Russian involvement in U.S. election

With North Korea crisis mounting, Trump meets with Chinese President Xi

Ivanka Trump takes center stage at G-20 as president pledges $50 million for women's program

The communique included what appeared to be a U.S.-written dissent to the agreement, saying that the United States "affirms its strong commitment to an approach that lowers emissions while supporting economic growth and improving energy security needs."

The other signatories were clearly disappointed in the U.S. refusal to sign on. "Where there is no consensus, even the dissent must appear in the communique," said German Chancellor Angela Merkel, the host of the G-20 summit and a driving force behind the communique.

Gary Cohn, Trump's chief economic adviser, compared the dispute to 20 friends trying to agree on where to have dinner. "We do go out of our way to say in there that we do support the environment," he said.

Merkel, this year's host for the annual meeting of the world's 20 largest economies, had set out an agenda for the summit that included climate change, trade and migration.

And on those other issues, Merkel found a way to accommodate Trump's view of U.S. national interests.

• On trade, the document said member countries would push for free markets, but also "strive to ensure a level playing field." It recognized the legitimate right of counties to retaliate against unfair trade practices.

• On migration, the 20 countries expressed support for "those countries that choose to develop pathways for migration." But it also recognized "the sovereign right of states to manage and control their borders."

The G-20 members include Argentina, Australia, Brazil, Canada, China, Germany, France, India, Indonesia, Italy, Japan, Mexico, Russia, Saudi Arabia, South Africa, South Korea, Turkey, the United Kingdom, the United States and the European Union.