TAORMINA, Sicily — It could have been worse. A lot worse.

As leaders of the G7, the elite group of established democracies, concluded their annual clubby retreat Saturday, that was the general takewaway. The glorious Sicilian sun above them wasn't the only bright spot: while U.S. President Donald Trump's unpredictable positions on climate change and free trade have imperiled the group's unity as never before, his counterparts were heartened that Trump showed up at all.

That's how low the bar has been set: points for attendance.

European Council President Donald Tusk had predicted it would be "the most challenging G7 summit in years." And in many ways, it was, with leaders forced to issue a declaration in which six of the seven reaffirmed their "strong commitment" to the Paris accord on climate change. Trump, the seventh, was still thinking about it.

But at least he's thinking.

"There were fears: would he attend the G7?" one senior EU official said, noting that Trump's election had called into question "the entire Western architecture, post Second World War."

"Now he's here," the official said. "He engages."

By all accounts, the other six leaders were heartened that Trump gave them a chance to make their case for the Paris agreement, that he was willing to include language in the declaration about fighting protectionism, and that he joined them in maintaining a hard line on Russia, at least when it comes to the conflict in Ukraine.

To be sure, Trump was not always the most active and engaged participant. On Saturday, Trump tweeted about NATO military spending — a focus of his Brussels visit on Thursday — and about terrorism, which G7 leaders discussed Friday.

"It is no secret that one of the participants potentially has new views on some fundamental issues," the EU official said. "It's not a given that G7 unity can be kept."

Class of 2017

Trump was one of four leaders attending their first G7 summit this year. Gentiloni, U.K. Prime Minister Theresa May, and French President Emmanuel Macron were all newbies, too. Canadian Prime Minister Justin Trudeau was attending his second.

But only Trump arrived in Sicily contemplating broad shifts in his nation's policies on major global issues. Even May, who is leading the U.K.'s departure from the EU, remained in total lockstep with her European colleagues on the big issues on the table at the G7.

Rather than pressure him, however, Trump's counterparts in the G7 sought to grant him wide room to figure out his place on the world stage. And they adjusted the language in their annual declaration in ways that showed Trump was already making a mark.

The preamble, which last year focused on a coordinated international effort to spur economic growth and tackle political problems, this year had new populist flair. It declared that the leaders were meeting to address "in a spirit of cooperation, the global challenges we face today and to respond collectively to the greatest concerns of our citizens."

"Our common endeavor is to build the foundations of renewed trust, both towards our governments and among our countries," the leaders declared.

"Trump is deciding, but on climate we did not retreat one millimeter" — Italian Prime Minister Paolo Gentiloni

The leaders' revamped their language on trade, to accommodate Trump's concerns about the drawbacks and downsides of big trade agreements. "Trade has not always worked to the benefit of everyone," they said.

Some aspects of last year's declaration, including an emphasis on promoting universal health coverage, seemed to reflect priorities of Trump's predecessor, Barack Obama. Those were removed this year. But, by all accounts, Trump did not seek to exert heavy influence on the final statement.

The leaders also dealt head-on with Trump's request for more time to make a decision the Paris accord, specifically stating: "The United States of America is in the process of reviewing its policies on climate change and on the Paris Agreement and thus is not in a position to join the consensus on these topics."

Gentiloni, in his closing news conference, did not criticize the president. But he made clear the others were not changing their positions. He said simply, "Trump is deciding, but on climate we did not retreat one millimeter."

When the six leaders (minus May who returned to London Friday night) posed for a photo Saturday with a larger group of international leaders who joined some of the sessions, Trump was put front and center in the first row, next to Gentiloni, the host. Merkel, the most seasoned G7 leader, now attending her 12th summit, was in the second row.

That choreography seemed to reinforce an overall effort by the rest of the G7 to make Trump feel welcome and well-respected, to be sure that he didn't regret the trip to Sicily — and perhaps to show that multilateralism and dialogue aren't so bad after all, especially when you're part of an elite club.

This article has been updated.