COLOGNE, Germany — No matter who wins the upcoming U.S. presidential election, German defense officials have telegraphed in recent months that they regard America’s retreat from Europe a challenge they can try to manage, but not avoid.

The assumption has major consequences, potentially throwing the European economic powerhouse into the kind of geopolitical driver’s seat that leaders here have long sought to avoid, and for which the country is ill prepared.

On the one hand, the message of America losing interest in the continent has given fresh impetus to the defense ministry’s plea of keeping defense spending up despite the economic hardship wrought by the coronavirus pandemic.

But Berlin’s judgment also has darker undertones, reflecting a mistrust towards Washington nursed from years of abrasive relations with U.S. President Donald Trump and his emissaries. While another Trump term would likely continue to shake the traditional liberal world order, the idea that Democratic challenger Joe Biden could clinch the presidency and remake U.S.-German bonds is met here mostly with shrugs.

That is because the bigger forces at play — particularly how U.S. attention is now consumed by China — are unlikely to change either way, said Carlo Masala, a professor for international relations at the Bundeswehr University in Munich. In addition, he predicted that the dynamic of Washington keeping the pressure on Germany for greater financial, political or even operational commitments would remain the same under Biden.

“There is a bipartisan consensus that Germany and Europe don’t invest enough in their own security, and that they are free riders unable to adequately support the United States in its role as a global superpower,” Masala said.

That image is partly of Germany’s own making, robbing Berlin of a substantive comeback to Trump’s tirades. With roughly 1.2 percent of its gross national product spent on defense, the country is far from meeting the NATO-wide spending target of 2 percent by 2024.

On other fronts, however, officials here should be more confident as a decades-long ally, said retired Lt. Gen. Ben Hodges, a former commander of U.S. Army forces in Europe.

He said Berlin seemed “almost meek,” for example, when it came to countering the false charge by Trump that Germans were unduly making money off American installations that the Pentagon has long used to train, stage and command forces.

The U.S. president has used that narrative to justify the withdrawal of roughly 12,000 troops from Germany, undercutting the Pentagon’s claim that the move is the result of some kind of thorough analysis rather than a punishment aimed at Berlin.

“Germany is the United States’ most important ally in Europe when it comes to economic and security cooperation, especially now that the U.K. seems to have a weaker position in Europe, post-Brexit,” Hodges said.

But, he added, “A relationship takes two. Germany has always held the United States to a higher standard, and it’s unfortunate when the Americans can’t live up to that. But it’s equally unfortunate when Germany doesn’t live up to the expectation of leadership in Europe,” including defense spending.

Germans will have plenty of time to debate their trans-Atlantic vision in the 2021 election year, when the era of Chancellor Angela Merkel comes to an end. There is every expectation in Berlin that reltions will go from bad to worse if Trump remains president, and such a scenario could quickly sideline Germany’s scrappy cadre of trans-Atlantic optimists.

If Biden wins in November, however, he could face a Berlin government so set on the expectation of an American withdrawal that it crowds out any potential to imagine another trajectory.

There may be something of a self-fulfilling prophecy at play, said Sophia Becker, a research fellow at the Berlin-based German Council on Relations (DGAP). “When you say, ‘Nothing will change,’ then truly nothing will change.”

German attitudes towards the United States will be closely watched by future leaders in Washington, she added.

To be sure, touchpoints exist between the two countries’ defense objectives, even beyond the traditional focus on Europe and Russia. For example, government officials in Berlin recently rolled out a set of policy guidelines for the Indo-Pacific region, which calls for strengthened ties with governments there, including in the field of security cooperation.

“If we miss the runway, then we’ll have nothing in hand other than a bouquet of flowers come Nov. 4,” said DGAP analyst Christian Mölling, referring to the chance of a Biden win. “We should start packaging the gifts now.”

Whatever happens, “I hope Germans will take the long-term view,” said Hodges. “Germany has been through decades of US election cycles. The idea that only the past three years have been bad is not entirely true.”