U.S. Army troops prepare a tank after arriving at the Gaiziunai railway station, west of Vilnius, Lithuania, on Feb. 10. (Mindaugas Kulbis/Associated Press)

President Trump sent Defense Secretary Jim Mattis to Brussels to press European allies on Wednesday to do something they have long been reluctant to do: open up their wallets on defense in an era of austerity and budget cuts.

The hammer-hard message — a warning from Mattis that allies must significantly increase their defense spending “if your nations do not want to see America moderate its commitment to this alliance” — was a harsh threat to countries that have been struggling with anemic growth and high unemployment.

Europe’s defense spending was already increasing before Trump’s November victory, but only four NATO member countries apart from the United States meet the alliance’s budget minimums. Now, Europeans have been jolted by Trump’s questioning of the basics of U.S. foreign policy since World War II. They are ­scrambling to do even more, ­motivated by dueling fears: Many Europeans worry the Trump ­administration may not rush to their defense if needed. But the prospect of being dependent on an erratic United States for ­security is also frightening to some policymakers.

Mattis began the Trump ­administration’s push at a Wednesday meeting of NATO defense ministers in Brussels. On Friday, Mattis will be joined in Munich at a security conference by Vice President Pence, Homeland Security Secretary John F. Kelly and more than a dozen members of Congress, many of whom have turned out to reassure U.S. allies that Washington remains committed to them.

But the hammer-heavy ­pressure to increase defense spending will still be a major challenge for Europe, particularly in a year when elections in the ­Netherlands, France and ­Germany feature insurgent ­anti-establishment nationalists who, like Trump, question the need for international alliances.

“What has happened is that in Europe we harvested the peace dividend very, very quickly” after the end of the Cold War eliminated the need for large standing armies, said Anders Fogh Rasmussen, a former NATO secretary general who led the 2014 effort to secure pledges from NATO ­members to spend 2 percent of their annual gross domestic ­product on defense. 

Defense spending quickly withered after the breakup of the Soviet Union, as new security threats tended to be addressable through light, quick-moving ­forces. But capabilities eroded so deeply that the Belgian military was left asking for U.S. hand-me-down flak jackets for its soldiers when it deployed domestically in the wake of terrorist attacks in Paris and Brussels in recent years. The problem was even greater on NATO’s eastern border, where Russian President Vladimir Putin revived fears of an old-style ­European ground war following his 2014 annexation of Ukraine’s Crimean Peninsula.

“The security insurance has been more expensive because of Mr. Putin’s actions in Eastern Europe, so we have to reverse the trend,” Rasmussen said.

The United States spends 3.6 percent of its GDP on defense, or $664 billion annually, the alliance leader in both measures according to NATO figures. Britain, the runner-up in dollar terms, spends $52 billion, or 2.2 percent. NATO Secretary General Jens Stoltenberg announced Tuesday that Washington’s allies in Europe and Canada increased their defense spending by 3.8 percent last year, or $10 billion, which is greater than originally expected.

But the effort to increase spending even more quickly is running headlong into European Union rules that tightly limit the amount of money governments can borrow to fuel their budgets. Following pallid economic growth and years of ­austerity-fueled cutbacks, ­defense is rarely the first priority for voters.

In France, for example, far-right leader Marine Le Pen has surged to the top of opinion polls ahead of the first round of presidential elections in April by campaigning on a platform of shutting out immigrants, bolstering social spending and holding a referendum on E.U. membership.

Le Pen said this month that she wants to pull out of NATO’s integrated military command “so that France is not drawn into wars that are not its own.” 

Other far-right politicians, such as Geert Wilders in the Netherlands and the leaders of the Alternative for Germany ­party, favor staying in NATO. But their desire for rapprochement with Russia could undermine ­efforts to bolster European ­defenses against Kremlin ­challenges, analysts say.

The spending challenges are stark in a nation like Spain, where the defense budget is less than half the NATO-pledged level, but youth unemployment stands at 42.9 percent. Italy faces similar issues.

A separate difficulty for the Baltics — where Estonia already spends more than NATO’s baseline, and Latvia and Lithuania are soon set to achieve it — is that money devoted to education and health can also be seen as a security investment, given large domestic Russian communities whose loyalties might be stronger if they feel they benefit from their governments. But leaders say that NATO is of such fundamental importance that they will meet those commitments first and address other issues later.

“In Latvia’s case, there will be no need to spend money on health and education if your country ceases to exist,” said Artis Pabriks, a former Latvian defense minister who is now in the ­European Parliament.

But even wealthy Germany has lagged on defense spending as its economy has consistently grown in recent years.

That has made it a primary target of U.S. efforts for a spending turnaround. Germany now spends 1.2 percent of its annual economic output, or $39 billion. To make it to NATO guidelines would require a $36 billion ­annual increase.

German leaders have committed to reaching that level by 2024, although many officials say privately that they see it as unrealistic. An increase of that level would require a radical reorientation of the country’s complicated relationship with its military. Many Germans grew up shunning the armed forces in the aftermath of World War II.

But senior defense leaders say that major changes are necessary, and German faith in the United States is plummeting so quickly that there may be a prime ­political window to push for an even faster spending increase. Only 22 percent of Germans say they believe they can trust the United States as a partner, according to a poll released this month by German public television. That is down from 59 percent in November.

The U.S. demand for more spending “is a fair request,” ­German Defense Minister Ursula von der Leyen said after meeting ­Mattis last week in Washington. “Everyone has to make a ­contribution.”

More broadly, Trump’s ascendance has touched off a debate in Europe about whether it should expect American support as a safety net for issues the continent is unable to handle, analysts say.

“At the end of the day it’s a question of the level of ambition,” said Markus Kaim, a security analyst at the German Institute for International and Security Affairs, which advises the ­German government on policy issues. “The question is: What role do we want to play in the international system?”

Europe is already in the ­driver’s seat in resolving the crisis in Ukraine, where most peace talks have been brokered by ­Germany and France alongside Russia and Ukraine. On Syria, however, the E.U. is playing only a minimal role, even though the war’s consequences have a more direct effect on Europe than on the United States.

“The Europeans are really punching below their weight,” said Fabrice Pothier, a senior fellow at the Atlantic Council who until last year was a senior NATO official. “There is the need to make a big leap forward.”