LA MALBAIE, Quebec — Hours before President Trump landed in Canada on Friday, 18-year-old allegations that Justin Trudeau once groped a reporter resurfaced on a website sympathetic to the president.

Coincidence? Maybe, maybe not.

But it only added to the mounting tensions between Mr. Trudeau, now the Canadian prime minister, and Mr. Trump as the president arrived for the Group of 7 summit meeting that had become so fractured before it started that many observers were calling it the “G-6 plus 1” — with Mr. Trump being cast as the irrational, irascible and dangerous outsider.

When the two leaders finally met on the grounds of a grand Quebec hotel on Friday, they had a brief, cordial exchange and made no show of the antagonism between them that has grown over the past week. Instead, Mr. Trudeau gave his telegenic smile, and Mr. Trump gave a thumbs up for the cameras.

It has always been an article of faith that maintaining good ties with the United States was essential for Canada, but with Mr. Trump’s imposition of tariffs and unfounded accusations of 200-year-old acts of aggression by Canada against the United States, Canada’s priorities have changed. Now Mr. Trudeau will be expected to protect not only the economy of Canada, but also its dignity.