President Donald Trump blasted Canadian Prime Minister Justin Trudeau as "two-faced" on Wednesday after Trudeau was caught on an open mic with other world leaders discussing the NATO meeting in London and referencing Trump's lengthy press conferences.

The video, which quickly went viral online, showed Trudeau, British Prime Minister Boris Johnson, French President Emmanuel Macron and others speaking at a Buckingham Palace reception. The video begins with Johnson looking toward Macron and asking, "Is that why you were late?"

Trudeau jumped in, "He was late because he takes a 40-minute press conference off the top."

After a cut in the footage, Trudeau adds, "I watched his team's jaws drop on the floor."

In his closing news conference Wednesday, Trudeau confirmed that he had been talking about Trump, and said the moment that made "his team's jaws drop" was when the president announced the location for next year's Group of Seven summit at Camp David.

"Last night I made a reference to the fact that there was an unscheduled press conference before my meeting with President Trump and I was happy to take part of it but it was certainly notable, and I’ve had a number of good conversations with the president over the course of this day and yesterday," Trudeau said.

On Tuesday, Trump was involved in a 38-minute press event alongside Macron. Prior to that, the president spoke alongside NATO Secretary-General Jens Stoltenberg for about 53 minutes.

Download the NBC News app for breaking news and politics

Macron and Johnson's offices declined to comment on the video.

"Well, he's two-faced," Trump said of Trudeau alongside German Chancellor Angela Merkel on Wednesday. "And honestly with Trudeau he's a nice guy, but the truth is I called him out on the fact he's not paying 2 percent (in military spending) and I guess he's not happy about it."

Trump later canceled his remaining Wednesday press conference.

"When today’s meetings are over, I will be heading back to Washington," Trump tweeted. "We won’t be doing a press conference at the close of NATO because we did so many over the past two days. Safe travels to all!"

It's not the first time Trump has taken aim at his Canadian counterpart, calling Trudeau "very dishonest and weak" after a Group of Seven summit in Canada last year.

Asked about the president's comments Wednesday, Trudeau said he "has a very good relationship with" Trump.

The world leaders' overheard conversation took place at the end of whirlwind day in which Trump spent more than two hours speaking to reporters in sessions alongside the likes of Macron, Stoltenberg and Trudeau.

Trump earlier in the day criticized Macron for saying NATO was experiencing a "brain death," saying the remark was "very, very nasty" and "insulting," bashing his French counterpart's handling of the French economy. Then, while sitting alongside Macron, Trump jokingly asked if the French leader would "like some nice ISIS fighters?"

"I could give them to you," Trump said. "You could take every one you want."

"Let's be serious," Macron said, adding that the fight against ISIS is "not yet done."

"I'm sorry to say that," Macron said.