The leaders of the Group of 20 on Saturday agreed to a wide-ranging statement that included an agreement to reform the World Trade Organization (WTO) and a paragraph reiterating U.S. objections to the Paris climate change agreement -- after America reportedly played hardball over the language.

The nonbinding agreement came in Buenos Aires, where the leaders are meeting, after all-night talks over the specifics of the language. European Union officials told The Associated Press that the U.S. was the main holdout on almost every issue.

The communique says the leaders recognize that the multilateral trade system “is currently falling short of its objectives and there is room for improvement."

“We therefore support the necessary reform of the [World Trade Organization] to improve its functioning,” the document says. It did not go into detail about what those reforms should be.

President Trump has repeatedly ripped into the WTO and has threatened to pull the U.S. out of the organization, as he has done with the Paris climate accord and the Iran nuclear deal. It represents part of a broader push by Trump to separate the U.S. from agreements and obligations that he believes do not serve national interests.

“If they don’t shape up, I would withdraw from the WTO,” he told Bloomberg News in August, adding that the agreement establishing it was “the single worst trade deal ever made.”

A senior White House official said that the statement met many of the U.S. objectives and was the first time the G20 has said that the WTO is falling short of its objectives and needs reform. The official also noted language on workforce development and women's economic development.

Meanwhile on the Paris climate agreement, from which the U.S. announced its intention to withdraw last year, the documents says that the signatories “reaffirm that the Paris Agreement is irreversible and commit to its full implementation, reflecting common but differentiated responsibilities and respective capabilities, in light of different national circumstances.”

However, it then includes a separate paragraph expressions the U.S. opposition to the accord.

“The United States reiterates its decision to withdraw from the Paris Agreement, and affirms its strong commitment to economic growth and energy access and security, utilizing all energy sources and technologies, while protecting the environment,” the document says.

On migration, the statement is light and speaks vaguely of “global concern” about large movements of refugees and emphasizes “the importance of shared actions” to address roots causes and humanitarian need. The European officials told The Associated Press that the U.S. negotiator said too much talk about the issue would have been a “deal-breaker” for Trump.

The Wall Street Journal reported that the Europeans also agreed to U.S. demands to leave out of the statement tenets that protectionism and trade disputes are bad for the economy, and that global institutions are useful.

Trump has made trade a key issue for his G20 agenda. Speaking to reporters alongside German Chancellor Angela Merkel, Trump said that he was hoping to talk about trade. Trump also met with Chinese President Xi Jinping, where the topic of trade was likely to be brought up, considering the ongoing trade war between the two countries.

"Everyone agrees that the WTO should be reformed," Merkel said. "This is an important agreement."

Fox News' Kristin Brown and The Associated Press contributed to this report.