President Trump revived one of his favorite lines of campaign rhetoric on Thursday, scolding NATO allies for not spending enough on defense.

Trump lodged his complaint during his first official meeting with leaders from the 27 other members of the alliance in Brussels.

"Member nations are still not paying what they should be paying," Trump said. "This is not fair to the people and taxpayers of the United States."

The remarks were surprising because Trump had recently changed his tune on the issue, saying in February that money was "pouring in" thanks to his intervention. He also described the group as "no longer obsolete."

Who's spending?

Trump's remarks on Thursday showed that spending remains a sticking point for his administration.

Here's what's going on:

It's true that NATO members are spending more. But the trend started well before Trump was elected, and it will be many years before some members are in a position to hit the group's spending target.

The group is slowly making progress, however. In 2014, members pledged to increase their outlays, and collective spending increased the following year for the first time in two decades.

Last year, 22 members spent more as a share of national economic output.

"The defense spending pledge was made in 2014. That's when some countries started to increase spending," said Claudia Major, a researcher at the German Institute for International and Security Affairs. "Trump became president in 2017. The timeline is clear."

The spending increases are designed to be gradual to protect the economies of members states.

"We have to remember what we actually promised. We didn't promise to spend 2% tomorrow. What we promised was to stop the cuts, gradually increase and then move towards 2%," NATO Secretary General Jens Stoltenberg said last week.

Stoltenberg said Thursday that NATO would ask member countries to develop national spending plans and report on their progress each year.

"This will be a new tool, to ensure we keep up the momentum and live up to our commitments," he said.

Related: How NATO is funded and who pays what

Many economies in Europe are still suffering from budget cuts imposed as part of austerity programs. Unemployment remains high and while growth is recovering, it remains relatively weak.

"To reach the goal by 2024, some countries, for example Spain, would have to increase their spending by 15% every year. That's not feasible," Major said.

Greece, one of the handful of countries of countries that meets the spending target, has been criticized for years by its creditors for spending too much on overpriced military contracts.

Major suggested NATO countries should focus on efficiency. "Europeans need to spend more, but they also need to spend well. The 2% target doesn't measure the results."

NATO is based on the principle of collective defense: an attack against one or more members is considered an attack against all.

But there is no penalty for countries that don't meet the spending target.

Germany spent 1.19% of its GDP on defense last year, France forked out 1.78%. Canada, Slovenia, Belgium, Spain and Luxembourg all spend less than 1%.

Fear of Russian aggression is driving some of the recent spending splurge. Latvia, which shares a border with Russia, increased its defense budget by 42% in 2016. Its neighbor Lithuania boosted its outlays by 34%.