WASHINGTON — President Trump alienated the United States’ closest allies at the Group of Seven summit in Canada with his aggressive trade declarations and surprising suggestion that Russia be readmitted to the exclusive club of major economic powers — and then, after departing early, went on Twitter to blow up the agreement forged at the meeting.

Trump exited the Quebec resort Saturday where the group had gathered, leaving other world leaders whipsawed and uncertain about their future relationship with the U.S., to head to Singapore for a summit with North Korean leader Kim Jong Un on Tuesday.

Trump’s actions added to the anxiety of longtime U.S. allies, who are alarmed to see him lashing out against them while he is advocating for Russian President Vladimir Putin and cozying up to Kim.

“I’ll be on a mission of peace,” Trump told reporters before heading for Air Force One to fly to Asia.

But his mission at the Canadian summit appeared to be chaos. And it didn’t stop when he left, as he later publicly backed out of his agreement to join the other six nations in signing a communique outlining shared principles at its conclusion. He blamed the host of the summit, Canadian Prime Minister Justin Trudeau, for the U.S. withdrawal, calling Trudeau “very dishonest & weak” after he criticized White House trade policies at the summit’s closing news conference.

Trump had earlier rattled top allies in the G7 with startling statements such as a proposal that all the nations drop all their tariffs and trade restrictions even as he has risked a global trade war by imposing U.S. tariffs on a variety of products.

“I don’t know if they were surprised with President Trump’s free-trade proclamation, but they certainly listened to it and we had lengthy discussions about that,” Larry Kudlow, Trump’s top economic advisor, told reporters.

Trump denied he was leaving the summit early because of tensions within the group and said his relationships with the other leaders “is a 10.”

But in his comments to reporters he ripped into his G7 counterparts, saying the U.S. is “like the piggy bank that everybody’s robbing, and that ends.” He vowed to control Iran’s nuclear ambitions “with or without them” and warned other members to drop their trade barriers with the U.S.

“It’s going to stop or we’re going to stop trading with them,” Trump said. “If they retaliate, they’re making a mistake.”

Trudeau, who hosted the G7 at a resort in Charlevoix, Quebec, told reporters that the summit was a success.

But he acknowledged that Trump, who at that very moment was tweeting warnings from Air Force One to Canada and other nations not to retaliate against his trade actions, did not leave happy.

“If the expectation was that a weekend in beautiful Charlevoix, surrounded by all sorts of lovely people, was going to transform the president’s outlook on trade and the world, then we didn’t quite perhaps meet that bar,” Trudeau said.

Trudeau said he and Trump clashed on trade, and he vowed that Canada would go ahead with retaliatory tariffs on U.S. products on July 1 if steel and aluminum tariffs aren’t dropped.

“I have made it very clear to the president that it is not something we relish doing but it is something that we absolutely will do, because Canadians, we’re polite, we’re reasonable, but we also will not be pushed around,” he said.

The U.S. and Japan refused to sign onto an agreement to take steps to address plastic pollution in the oceans, reflecting continuing tension between the Trump administration and America’s allies over climate change and other global environmental challenges.

But Trudeau said all seven nations had agreed to sign the communique, which outlined a shared commitment to work on a variety of economic, social, environmental and security issues.

The language on trade was general, with an acknowledgment that “free, fair and mutually beneficial trade and investment … are key engines for growth and job creation” and a promise to “develop new rules where needed to foster a truly level playing field.”

On climate change, the communique noted that all the nations except for the U.S. “reaffirm their strong commitment to implement the Paris Agreement” on climate change.

Trump later tweeted that he was pulling his support for the communique.

“Based on Justin’s false statements at his news conference, and the fact that Canada is charging massive Tariffs to our U.S. farmers, workers and companies, I have instructed our U.S. Reps not to endorse the Communique as we look at Tariffs on automobiles flooding the U.S. Market!” Trump wrote.

The communique that Trump ultimately decided not to sign also included a slap at Russia, calling on Moscow “to cease its destabilizing behavior to undermine democratic systems and its support of the Syrian regime.”

Trump skipped sessions on climate change and clean energy, as well as a working lunch to discuss protecting the world’s oceans, to depart early on Saturday.

Heading into the Quebec meeting, the U.S. already had strained relations with leaders of the other nations in the G7 — Canada, Britain, France, Germany, Italy and Japan — because of Trump’s decision to impose tariffs on imported steel and aluminum and his threats to extend trade levies to automobiles from those nations.

Trump justifies the tariffs by accusing other nations of taking advantage of the U.S. in trade. He argues that the levies will force other nations to lower their own barriers for American goods.

But the U.S. imposes tariffs and quotas of its own to protect certain products, particularly tobacco and sugar. Trump’s decision to bypass the World Trade Organization, set up to arbitrate tariff and other trade disputes, risks causing other nations to retaliate with protectionist measures that could damage the world economy.

Last year, Trump pulled the U.S. out of a sweeping Asian trade deal, the Trans-Pacific Partnership, struck by President Obama. He is threatening to walk away from the North American Free Trade Agreement with Canada and Mexico, which is being renegotiated at Trump’s behest.

Both Trudeau and French President Emmanuel Macron, who talked with Trump privately in separate meetings Friday, were sharply critical of him leading up to the G7 summit.

Trudeau called Trump’s U.S. national security justification for steel and aluminum tariffs — which implies Canada is a threat — “insulting and unacceptable.”

Trump told reporters Saturday that a renegotiated NAFTA would have to contain a sunset provision allowing the deal to expire after several years. Trudeau responded at his news conference by saying Canada would not agree to a sunset clause.

The president’s suggestion that Russia be readmitted to the group also did not go over well.

“Something happened a while ago where Russia is no longer in. I think it would be an asset to have Russia back in,” Trump told reporters Saturday.

Russia was expelled from what at the time was the Group of Eight in 2014 after invading Ukraine and annexing Crimea.

“Now, I love our country. I have been Russia’s worst nightmare,” Trump said. “But with that being said, Russia should be in this meeting.”

Although Italian Prime Minister Giuseppe Conte backed the idea, other G7 leaders dismissed it. In the U.S., key Democrats and some Republicans, including Sen. John McCain of Arizona, strongly objected to allowing Russia back into the group of advanced economies.

Trump told reporters Saturday that “some people like the idea of bringing Russia back in.”

But Trudeau told reporters he did not support it, saying he told Trump that “it is not something we are even remotely interested in looking at this point.”

Trump, when pressed on whether he would require Russia to give up Crimea as a condition, indicated he wouldn’t, noting, “They spent a lot of money on rebuilding it.”

“Crimea was let go during the Obama administration.… He allowed Russia to take Crimea. I may have had a much different attitude,” Trump said. “With that being said, it’s been done a long time.”

jim.puzzanghera@latimes.com

Twitter: @JimPuzzanghera