President Donald Trump declared NATO a “fine-tuned machine” and boasted of increased spending commitments from allies near the conclusion of a contentious NATO summit during which he has questioned the utility of the alliance and harshly criticized some of the United States’ closest allies for not paying more on defense spending.

Taking a self-congratulatory tone, the president said Thursday in an impromptu news conference that the alliance is much stronger than it was at the outset of the conference and took credit for what he said was substantially increased spending, citing a figure of increased spending this last year to the tune of $33 billion.

“Yesterday, I let them know that I was extremely unhappy with what was happening and they have substantially upped their commitment and now we're very happy, and have a very, very powerful, very strong NATO; much stronger than it was two days ago,” Trump said.

Soon after his victory lap in trumpeting an increased spending commitment by allies, French President Emanuel Macron directly contradicted Trump and said there was no such agreement to increase spending beyond previously agreed upon levels.

The president also told reporters he “probably” had the unilateral power to pull the United States out of NATO if he chose to do so but said he thinks it’s unnecessary.

While the president has had harsh words for the alliance during the two-day summit, even asking in one tweet "what good is NATO," he ultimately reaffirmed the United States' firm commitment to NATO, saying it “remains very strong.”

"I believe in NATO,” Trump said of the North Atlantic Treaty Organization. “I think NATO is a very important, probably the greatest ever done. But the United States was paying for anywhere from 70 percent to 90 percent of it, depending on the way to calculate it.”

Trump next heads to the United Kingdom for a working visit and then to Finland for a meeting with Russian President Vladimir Putin. Trump said he intends to talk to Putin about its alleged meddling in the 2016 U.S. election.

"We will be asking, of course, your favorite question about meddling. We're going to ask that again,” Trump said. “He may deny it. All I can do is say it."

The president again described Putin as a competitor, declining to characterize the longtime U.S. adversary as an enemy even as he said he hopes one day they might even be friends.

“He's representing Russia, I’m representing the United States,” Trump said. “So in a sense, we are competitors, not a question of friend or enemy. He's not my enemy and, hopefully someday, maybe he'll be a friend. It could happen.”

Trump said other leaders at the summit have thanked him for meeting with Putin, even as he sought to keep expectations low for what comes out of the meeting.

“We will see what happens -- just a loose meeting. It's not going to be a big schedule,” he said.

“I don't think it should take a very long period of time and we will see where it leads but could lead to productive, something productive. And maybe it's not but I think meeting with people is great.”

As he makes his way to the United Kingdom, the president said he's aware of the protests but said he thinks the U.K. people like him a lot and agree with his tough stance on immigration.

"I think they like me a lot in the U.K.,” he said. “I think they agree with me on immigration. I'm very strong on immigration. I've made a point today, I said, ‘You've got to stop, you're ruining -- you will have a lot of problems.’ You see what's going on throughout the world with immigration. I probably at least partially won an election because of immigration."

And while the United Kingdom is embroiled in internal political chaos as Prime Minister Theresa May works to implement plans for the United Kingdom to withdraw from the European Union, Trump said he won't be bringing a message on the issue that was voted for by the people of the United Kingdom.