NATO Secretary General Jens Stoltenberg said Sunday that US President Donald Trump’s frequent complaints about the alliance have had a positive impact.

Trump has often claimed that members of the 29-nation western security bloc do not spend enough on national defense.

Before taking office, he called NATO “obsolete” and recent news reports said he spoke to senior officials last year about withdrawing from it.

“President Trump has been very clear, he is committed to NATO. He stated that clearly just a few days ago and also at the NATO summit in July,” Stoltenberg said on the American TV program Fox News Sunday.

“But at the same time, he has clearly stated that NATO allies need to invest more. And therefore at the summit in July last year, we agreed to do more to step up – and now we see the results.”

NATO members agreed in 2014 to spend 2% of their gross domestic product on defense by 2024 but around half are not on course to achieve that target.

However, Stoltenberg said that by the end of 2020, NATO allies would have injected an extra $100 billion into defense.

“So we see some real money and some real results. And we see that the clear message from President Trump is having an impact,” he added.

“NATO allies have heard the president loud and clear and now NATO allies are stepping up. So this is good news meaning that we actually see more fair burden sharing.”

Earlier this month Trump reiterated his opinion that close allies had been taking advantage of the US security umbrella for decades and that it was his job to stop that.

“We cannot be the fools for others. We cannot be. We don’t want to be called that. And I will tell you for many years behind your backs, that is what they were saying,” he said during an address to the Pentagon.

The president acknowledged Stoltenberg’s positive feedback soon after the interview aired, tweeting that sharing defense costs had made NATO “more united.”

“Dems & Fake News like to portray the opposite!” he added.

Stoltenberg was in Washington to meet with Secretary of State Mike Pompeo, acting Defense Secretary Pat Shanahan and national security adviser John Bolton.

– with reporting by Agence France-Presse