WASHINGTON — President Trump will skip most of the second day of a summit meeting with allies this weekend, the White House said late Thursday, as he engaged in a contentious war of words over trade on the eve of a gathering that will underscore his isolation from the leaders of the world’s largest economies.

Sarah Huckabee Sanders, the White House press secretary, announced that Mr. Trump will leave Canada at 10:30 a.m. Saturday, well before scheduled sessions on climate change, clean energy and oceans. He will attend an early-morning session on “women’s empowerment,” but he will be gone before any joint statement is issued by the other leaders.

Earlier Thursday, President Emmanuel Macron of France and Prime Minister Justin Trudeau of Canada lashed out at Mr. Trump for imposing tariffs on their steel and aluminum industries. They called it an illegal economic assault on their countries that is unanimously opposed by the other leaders of the Group of 7 who will gather Friday in a sleepy village in Quebec for their annual summit meeting.

“The American President may not mind being isolated, but neither do we mind signing a 6 country agreement if need be,” Mr. Macron said Thursday in an especially acerbic tweet. “Because these 6 countries represent values, they represent an economic market which has the weight of history behind it and which is now a true international force.”