President Donald Trump was standing feet away from other NATO member leaders when he scolded 23 of the 28 member nations for not meeting their defense spending obligations.

Trump was visiting at NATO headquarters in Brussels, Belgium when he made his remarks after leading a moment of silence for the victims of the terrorist attack in Manchester, England. Trump said the NATO of the future must focus on terrorism and immigration, as well as the threats of Russia on NATO's southern and eastern borders.

"These grave security concerns are the same reason that I have been very, very direct with Secretary [Jens] Stoltenberg and members of the alliance in saying that NATO members must finally contribute their fair share and meet their financial obligations," Trump said. "But 23 of the 28 member nations are still not paying what they should be paying and what they are supposed to be paying for their defense. This is not fair to the people and taxpayers of the United States."

Trump hosted NATO's Secretary General Jens Stoltenberg at the White House last month and remarked that he no longer thought NATO was "obsolete," as he had said it was on the campaign trail.

Trump pointed out that the U.S. spent more on defense in the past eight years than all other NATO members combined.

"We should recognize that with these chronic underpayments and growing threats, even two percent of GDP is insufficient to close the gaps in modernizing readiness and the size of forces," he said. "We have to make up for the many years lost. Two percent is the bare minimum for confronting today's very real and very vicious threats."

According to the New York Times, the only other NATO countries besides the U.S. to meet the goal of spending two percent of GDP on defense were Britain, Estonia, Poland and Greece.

A CNBC reporter noted the stony expressions on the faces of some of the NATO countries' leaders during Trump's remarks.

Just look at the reaction of NATO members as Trump said directly to their faces that 23 out of 28 nations aren't contributing enough. pic.twitter.com/wG3ppeRI97 — Steve Kopack (@SteveKopack) May 25, 2017

But Trump also elicited chuckles from members with a friendly joke.

"And I never asked once what the new NATO headquarters cost. I refuse to do that. But it is beautiful," he said.