He dismissed as paltry — “a very small step,” the president said — the increases that NATO member countries have made in their military budgets in part because of his repeated lectures on the issue, eschewing a victory lap his advisers had encouraged him to take in favor of a sharp slap at allies.

“Frankly, many countries owe us a tremendous amount of money for many years back, where they’re delinquent, as far as I’m concerned, because the United States has had to pay for them,” Mr. Trump said, mischaracterizing how the commitments for NATO military spending work. “This has gone on for many presidents, but no other president brought it up like I bring it up.”

“Something has to be done,” he added.

His comments came at a time when Mr. Trump’s own ties to Russia are under scrutiny and as he is also waging a spreading trade war that has ensnared allies — including NATO members like Canada and Germany — as well as foes and competitors like China. His approach has fueled concern among his critics at home and abroad that he is intent on deconstructing the postwar order and replacing it with an “America First” breed of transactional diplomacy.

At the same time, Mr. Trump’s aggressive pressure tactics have already yielded more military spending by NATO allies and a sharper focus on the issue of unbalanced burden-sharing within NATO that vexed Presidents Barack Obama and George W. Bush before him.

Behind closed doors, Mr. Trump suggested that NATO allies increase their military budgets not to the 2 percent of their economies that they have pledged to work toward within the next six years, but to 4 percent — a steep increase that is inconceivable for many member countries. Later, he took to Twitter to demand that member countries get to 2 percent “IMMEDIATELY, not by 2025.”

“What good is NATO if Germany is paying Russia billions of dollars for gas and energy?” the president wrote. “Why are there only 5 out of 29 countries that have met their commitment? The U.S. is paying for Europe’s protection, then loses billions on Trade.”