NATO's secretary general agreed on Wednesday that President Trump's call for other members to boost their defense spending under the military alliance is having an effect, and promised that other NATO members would soon be chipping in more.

Trump was in Belgium Wednesday to keep up his complaint that other NATO members are "not paying what they should," and said it's an "unfair burden" to the U.S.

NATO Secretary General Jens Stoltenberg agreed.

"We all agree that we have to do more," he said in a joint appearance with Trump. "I agree with you that we have to do make sure that our allies are investing more. And last year was the biggest increase in defense spending across Europe and Canada in that generation."

"Why was that last year?" Trump asked.

"It's also because of your leadership, because of your carried message," Stoltenberg said.

"They won't write that, but that's OK," Trump replied, referring to members of the press.

"No, I have said it before, but the thing is that it really has," Stoltenberg said. "And your message is having an impact, and we are going to build on that to make sure that we have further increases."

Stoltenberg said Trump was pressing last year for countries to boost their NATO contribution, and said as a result, Europe and Canada combined will add another $266 billion through 2024 to the alliance.

Trump also used his public appearance with Stoltenberg to complain that Germany continues to get up to 70 percent of their energy from Russia. He said that's a "very bad thing" for NATO, and hinted it gives Russia leverage over Germany so it doesn't contribute more to NATO.

Stoltenberg said NATO is still a strong alliance despite Germany's energy position with Russia, but Trump disagreed.

"But how can you be together when a country is getting its energy from the person you want protection against or from the group that you want protection?" Trump asked.

"Because we understand that when we stand together, also in dealing with Russia, we are stronger," Stoltenberg said.

"No, you're just making Russia richer," Trump shot back. "You're not dealing with Russia. You're making Russia richer."