The United States was the lone holdout on endorsing a global agreement to combat climate change at the G-7 summit Saturday — but President Trump promised to decide within days.

“I will make my final decision on the Paris Accord next week!” Trump tweeted from Italy as the meeting of wealthy democracies concluded.

He arrived back in Washington shortly before 9 p.m.

A joint communique from the G-7 leaders emphasized their near-unanimity on the climate deal. They pledged to “swiftly implement” limits on greenhouse-gas emissions and called out the Trump administration for its reluctance to follow through.

“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,” the statement read.

German Chancellor Angela Merkel was a bit more harsh in her assessment of Trump’s position. She said it was a “situation of six against one,” and called the discussion “very difficult, not to say very unsatisfactory.”

But an exultant Trump ignored the criticism as he wrapped up his nine-day, four-nation tour with a speech to US and allied military personnel at Naval Air Station Sigonella on the Italian isle of Sicily.

“I think we hit a home run no matter where we are,” he crowed, as he reviewed trade deals struck in Saudi Arabia, NATO allies’ cost-sharing promises and the G-7’s agreements on fighting terrorism and promoting trade.

Calling his trip “a truly historic week for our country,” Trump spoke to the troops — whom he hailed as “the warriors of freedom” — about his push to get sharp increases in defense spending from NATO allies.

”Other member nations must pay more,” he said, to cheers.

NATO members have committed to spending 2 percent of GDP on defense by 2024, which experts say would reduce pressure on US military spending.

“I will tell you, a big difference over the last year,” Trump said. “Money is actually starting to pour into NATO from countries that would not have been doing what they’re doing now had I not been elected, I can tell you that.

“We’re behind NATO all the way, but we want to be treated fairly,” he said.

Trump called the G-7 conference “a tremendously productive meeting where I strengthened American bonds — we have great bonds with other countries — with some of our closest allies.”

He didn’t mention the stark climate-change division within the G-7 or the public grumbling of Merkel and other leaders.

The 2015 Paris climate agreement, championed by President Barack Obama, pledged industrial nations to steep reductions in carbon emissions.

Trump called global warming “an expensive hoax” in 2014 and criticized the deal on the campaign trail. “The president is spending time on the topic,” said Gary Cohn, Trump’s top economic adviser, Saturday.

Cohn called the G-7 leaders’ climate-change talks “a very constructive, very warm conversation.”

“We’re all allies all trying to get to right place and be respectful of each other,” Cohn said. “There was a lot of give and take from different countries in the room. They understand where we are.”

Trump spoke to the US troops in Italy just before he left for home aboard Air Force One.

First Lady Melania Trump listed the highlights of the trip as she introduced the president to the troops.

“We had the greatest time here. We did a lot of great stuff,” she said, before greeting her husband with a pair of cheek kisses.

“I’ve got to get the lipstick off,” Trump joked as he took the podium.

On his flight back to Washington, Trump put out a series of satisfied trade-related Twitter messages.

“Bringing hundreds of billions of dollars back to the USA from the Middle East — which will mean JOBS, JOBS, JOBS!” he wrote.