President Trump says his tough talk has made America's allies splurge on defense.

Speaking to Congress on Tuesday, Trump said NATO members must meet their financial obligations to the alliance. "And now, based on our very strong and frank discussions, they are beginning to do just that," he said.

"In fact, I can tell you, the money is pouring in," Trump added. "Very nice."

It's true that NATO countries are increasing their defense spending, but it has little to do with Trump. In fact, the changes have been in the works for years.

The big commitment was made in 2014, when all members that were spending less than 2% of GDP on defense promised to move toward the official target.

"All allies made a pledge ... to stop the cuts in defense spending, and to gradually increase spending towards the goal of 2% of GDP within a decade," a NATO official said Wednesday.

Related: The U.S. already spends more on defense than any other country

It's working: The alliance increased overall defense spending for the first time in two decades in 2015.

Last year, 22 of 28 NATO members increased their defense budgets. When the U.S. is removed from the equation, the group increased its spending by 3.8% in real terms in 2016.

Still, the alliance has a long way to go. Only five of NATO's 28 members -- the U.S., Greece, Poland, Estonia and the U.K. -- meet the 2% of GDP spending target.

The rest lag behind. 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%.

Trump vs. Trump: Who to believe on the global economy?

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%. Both, however, are still below the 2% threshold.

-- James Masters and Nadine Schmidt contributed reporting.