Brussels: US President Donald Trump on Thursday said that NATO countries have agreed to increase their military spending after he threatened to pull out at the summit here.

Speaking after a two-day summit in Brussels, he said allies had committed to spending more than 2 per cent of their annual output (GDP) on defence budgets, the BBC reported.

The President has been highly critical of the alliance, complaining the US pays more than other NATO members do. He singled out Germany on Wednesday for its "lagging defence spending" and accused it of being beholden to Russia as it buys energy from Moscow.

Trump said he would have been "very unhappy" if other NATO members didn't increase their defence spending.

"I told people that I would be very unhappy if they didn't up their commitments very substantially. Because the US has been paying a tremendous amount, probably 90 per cent of the cost of NATO."

But, after the Thursday conference, Trump said he believed in NATO and it was "presently unnecessary" to consider quitting it. "We made a tremendous amount of progress today... It has been really amazing to see the level of spirit in that room."

On being asked whether he was still threatening to potentially pull the US out of the NATO for any reason, Trump said: "I think I probably can, but that is unnecessary. They have stepped up today like they have never stepped up before."

He defended his approach to dealing with NATO allies, in particular Germany, calling it "a very effective way to deal".

Trump pointed to increased financial commitments from NATO allies as a measure of his success, though it was not immediately clear what specific pledges he secured and the President declined to elaborate beyond saying NATO allies will spend more on defence and faster.

He also pointed to progress over the last year, prior to this NATO summit. "We took in $33 billion more," Trump said, pointing to increased financial commitments.

Trump went on to say everybody in the room had thanked him, including NATO Secretary General Jens Stoltenberg, and described himself -- not for the first time -- as a "very stable genius", adding that he would not waver on his message.

In a separate briefing, German Chancellor Angela Merkel said there was a clear commitment to NATO from all attendees.

Trump's next stop after Belgium is the UK, where he will arrive on a two-day working visit. He will spend time with the Queen and Prime Minister Theresa May before flying to Scotland to spend the weekend at his golf resort.

Thousands of people are expected to protest against his visit across the UK. On July 16, he will meet his Russian counterpart Vladimir Putin in Finland's capital Helsinki.