Donald Trump has said NATO spending has been increased "like never before" following an emergency meeting.
The US president said members had agreed over two days of meetings in Brussels to increasing spending by £33bn – and to pay it "more quickly".
He said it was a "fantastic two days – the most magical I think I've ever lived" and said the other members are "really liking" what had been agreed.
The president claimed victory for getting Germany, and the other members, to increase their defence spending to 2% of GDP.
However, Emmanuel Macron, the president of France, denied his US counterpart's claim that NATO allies agreed to boost spending over 2%.
He said he did not think increasing defence spending to 4% would be a good idea, after confirming France will meet its commitment to spend 2% of its GDP by 2024.
Speaking at a last-minute news conference in Brussels, Mr Trump said: "The commitment was at 2% but ultimately that will be going up.
"The US commitment to NATO remains very strong but the spirit everyone has and the additional money they will be putting up has been really amazing.
"I hope that we're going to be able to get along with Russia, I think we probably will be able to.
"Nevertheless they stepped it up even further.
"We are doing numbers that we've never done before."
Despite criticising NATO heavily he appeared to have changed his mind since tweeting negatively about it on Wednesday.
He said that NATO was "another strong ally" that was "stronger than individual countries".
"I believe in NATO," he said.
However, he added several times that he thought the US was paying for "far too much" of the alliance and that NATO helped Europe more than it helped the US.
In response to a question about whether he would now alter the way he tweets because of the newly supported alliance, he said: "No, I'm very consistent, I'm a very stable genius."
He had picked Germany and Spain out for not paying enough towards NATO spending.
However, German Chancellor Angela Merkel appeared to be pleased after agreeing to increase spending.
She said it was an "intense summit" and "there was a clear commitment to NATO by all".
President Macron said the meetings over the past two days were "respectful".
He also said that Mr Trump "never at any moment, either in public or in private, threatened to withdraw from NATO", as had been reported.
The US president was asked about his visit to the UK, where protests are planned against him.
Speaking half an hour before getting on a plane to the UK, Mr Trump said: "I think it's fine. I think they like me a lot in the UK, they agree with me on immigration.
"I think that a lot of the people in the UK, I think that's why Brexit happened, I don't know what's happened with the negotiations.
"I'm going to a pretty hotspot right now with a lot of resignations.
"I told them today that the EU needs to be very careful because immigration is taking over Europe, I said that loud and clear."
On Brexit, he said: "I've been reading a lot about Brexit and it seems to be going a little differently recently.
"It's not for me to say, I own a lot of property there and I'm going to Turnberry in Scotland, which is a magical place, while I wait for the Monday meeting.
"I have great friendships, my mother was born in Scotland.
"But it's not for me to say, I'd like to see it go quickly.
"I would say that Brexit is Brexit, the people voted to break it up so I would imagine that's what they would do but they may be taking a bit of a different route.
"I just want the people to be happy because they're great people.
More from World
"Sure there'll be protests, but I believe the people in the UK, Scotland, Ireland, as you know I have property in Ireland, I have property everywhere.
"I think the people like me a lot."