WASHINGTON – Although candidate Donald Trump threatened to “dissolve” NATO if member nations didn’t pay up, President Trump on Wednesday praised the group as a “great alliance” – thanks, he suggested, to changes made because of his demands.

Appearing beside NATO Secretary-General Jens Stoltenberg at a White House news conference, Trump said that in addition to getting nations to increase their spending, he also had made the 28-nation alliance start paying attention to terrorism. “I said it was obsolete,” Trump said Wednesday. “It’s no longer obsolete.”

Just a year ago, at a campaign rally in Wisconsin, Trump promised he would tell NATO’s other member nations: “Fellas, you haven’t paid for years. Give us the money or get the hell out. Get out.”

That sentiment has persisted into his presidency. During a visit to the White House last month from German Chancellor Angela Merkel, Trump raised the issue with her about Germany’s NATO commitments. He tweeted the following day: “Germany owes vast sums of money to NATO & the United States must be paid more for the powerful, and very expensive, defense it provides to Germany!”

On Wednesday, Trump chided Stoltenberg regarding back payments that other countries supposedly still owe.

“I did ask about all the money that hasn’t been paid over the years ― will that money be coming back? We’ll be talking about that,” Trump said.

But it’s not clear whether the president fully understands how NATO is structured.

Each member state helps pay for the organization’s bureaucratic costs, but those payments are minuscule. Far more significant is the agreement that an attack on one country is considered an attack on all of their combined militaries.

Most NATO countries cut back on military spending following the breakup of the Soviet Union in 1991, as did the United States. In 2014, following Russian aggression in Ukraine and the rise of the Islamic State terrorist group on the border of member nation Turkey, NATO members agreed to increase their defense spending to 2 percent of their gross domestic product by 2024.

Neither the United States nor NATO itself acts as a central bank for the alliance, collecting dues or allocating payments. Rather, each nation raises money from its own citizens to spend on defense. No country “owes” the United States, or NATO, anything for past budgetary choices.

As for focusing on terrorism, the first and only time NATO invoked the common defense element of its charter was after al Qaeda terrorists attacked the United States on Sept. 11, 2001. NATO forces subsequently attacked al Qaeda and its sponsors, the Taliban, in Afghanistan.

Carlos Barria / Reuters President Donald Trump and NATO Secretary-General Jens Stoltenberg hold a joint news conference in the East Room at the White House, April 12, 2017.

U.S. Defense Secretary James Mattis has said he would like to see NATO member nations’ plans to reach that 2 percent target by the end of this year. Stoltenberg says he has made it his top priority to get member nations to increase their military spending.

“For the first time of the many, many years of decline in defense spending, we now see an increase in defense spending across Europe and Canada. So they have started to move in the right direction,” Stoltenberg said Wednesday, adding that next year, eight of the 28 nations would be spending 2 percent, up from five last year.

The United States, in contrast, has been spending closer to twice that target percentage ― 3.6 percent in 2015 ― on defense, although that total includes spending on Navy, Air Force and troop deployments in the Pacific and other parts of the world.

Whether those costs ― which are difficult to parse, as the defense budget is not structured geographically ― can reasonably be allocated as NATO-related is debatable. Some analysts argue that all U.S. defense spending can be thought of as beneficial to NATO.

“Even U.S. Pacific forces contribute to NATO’s security by deterring conflict and ensuring free flow of trade,” said Katherine Blakely, a research fellow with the Center for Strategic and Budgetary Assessments. “Even if other NATO member nations weren’t involved in a conflict, the economy of NATO states would take a huge hit if there was a major conflict in the Asia-Pacific [region].”

During Trump’s campaign, he frequently bashed NATO and accused other member nations of taking advantage of the United States. He regularly called the organization “obsolete.”

“It’s obsolete. We spend too much money. We’re not getting the benefits that we should be getting for the money,” Trump told Fox News in April 2016.

At the Wisconsin rally that same month, Trump also said: “Maybe NATO will dissolve and that’s OK. It’s not the worst thing in the world.”

“We have countries within NATO that are taking advantage of us. With me, I believe they’re going to pay,” he told NBC News in July 2016.

Trump’s comments have made European allies uneasy, particularly when combined with his strong and habitual praise of Russian President Vladimir Putin.

To assuage those allies, others in Trump’s administration have affirmed the United States’ commitment to the seven-decades-old alliance in visits to Europe. Trump himself is expected to attend a NATO summit in Brussels next month in what is to be the first foreign trip of his presidency.