US president Donald Trump has promised to put America first. His protectionist stance on trade, his implicit threats to pull military protection from countries that do not contribute sufficiently to NATO, and his decision to pull the US out of the Paris agreement on climate change are all designed to rebalance what Trump sees as a drain on American resources. But the net result may be to put America last, as allies in every part of the world seek out new relationships to shore up an international system on which they depend.

As the US loses influence, however, other countries will find opportunity. While Russia and China have aggressively courted influence, Europe, too, could be a beneficiary of America’s fall from global grace—if it plays its cards right.

Washington’s dirty secret is that America’s lead over the rest of the world—economic, military and political—has been in steep decline for decades. After World War II, the US constituted half of the global economy. Today, that share is closer to 25%, according to an analysis of the IMF’s World Economic Outlook Database. Meanwhile, challenger nations such as China have gone from having a GDP equal to less than one-fifth of the US economy in 1990 to exceeding it today (at least if GDP is adjusted for differences in purchasing power).

The miracle of American foreign policy has been the ability of successive administrations to maintain influence in the face of their country’s relative decline. US governments have attempted to ensure that every region of the world maintains a balance of power that ultimately favors American interests. This means that Washington could afford to lose weight in relative terms so long as smaller players in each region allied with America against the rising regional power—whether that regional power was China, Russia, or Iran.

The secret sauce of this strategy was the way Washington allowed its allies to share in the benefits of American hegemony. Europeans, for example, were allowed to benefit from US military spending and the security is provided without having to come up with equivalent spending on their own. Today, however, under the slogan “America First,” Trump is ripping up that playbook—and the net result could be that many American allies are forced to develop relations with regional challengers to hedge against their abandonment by Washington.

As a result, the US might well end up poorer, less influential, and less secure. The risk is not so much that the US incurs losses in individual diplomatic conflicts or isolated trade disputes. However, if America’s allies are forced into new alliances with America’s foes, the new system that emerges will be less conducive to America’s interests.

Trump’s proposals on trade policy and his Republicans tax plan has set the US on a collision course. Were Trump to implement a tariff on cars produced in Mexico, it would not only attract the wrath of Mexico—the German government could also be forced to act, given its car producers’ reliance on plants in Mexico. Congressman Paul Ryan’s plan for a corporate tax with border tax adjustment would have effectively put a tariff on imports into the US from everywhere in the world, and would have created the equivalent of an export subsidy for everything produced in the US.

While the border tax adjustment seems to be off the table for the time being, it remains to be seen whether it or a revised version will make a comeback, given the large funding gaps in current tax plans of the Trump administration. Both things are arguably in violation of US commitments to the World Trade Organization. One could continue the list of questionable protectionist initiatives launches by the Trump administration—from probes into potential steel tariffs to those into the (admittedly huge) German current account surplus.

A sensible strategy for the European Union here would be to join forces with China, South Korea, and Japan, not only to bring a joint case against America to the World Trade Organization, but also to start negotiating new trade agreements to hedge against potential losses in the US market.

China is clearly ready to jump into the void the US left when it pulled out of the Transpacific Partnership agreement. The nation’s participation in the TPP talks in Chile in March sent a clear signal to the rest of the world. Europe is also already preparing to reach out for new trading partners in Asia.

Trump’s recent grandstanding in front of NATO and at the G7 talks in Italy suggest he believes the European Union is weak and in disarray. Yet, after moderate parties won in Austria, the Netherlands, and France, commentators are beginning to wonder if the continent may indeed be about to turn a corner. It is possible that, following the election of the reform-minded and Europe-friendly Emmanuel Macron in France, the EU finishes the year in a much better shape than it did 2016. Even in its current state, the European Union can be expected to strongly defend its core economic interests—open global markets.

The US has taken its allies for granted before. Back in 2015, China announced its decision to form an Asian Infrastructure and Investment Bank. Washington tried to stop its allies from joining out of fear that this financial giant would threaten the status of the World Bank. This strategy collapsed, however, when the United Kingdom broke ranks and decided to become a founding member of AIIB.

The fallout was such that Singaporean diplomat Kishore Mahbubani claimed this event heralded the end of the American century: “No ally has been as faithful to the US as the British. Only they would follow the United States into the Iraqi quagmire— and that was only 12 years ago.”

Some people may counter that profit motivations do not always drive diplomatic decisions; national security has long been a strong driver of global alliances. Indeed, Asian countries have been sucking up to China economically for many years, while still working with Washington to contain Beijing’s military power.

But the decoupling of politics from economics could also be about to change. New economic alliances might eventually lead to a readjustment of geopolitical priorities by America’s old allies. If trade integration and trade dependence increases between the EU and China, for example, European governments might well be more reluctant to confront China when it comes to violations of international law in which they do not have a direct stake.

We saw this recently when the International Criminal Court ruled against China’s territorial claims in the South China Sea. Following the ruling, the European Union wanted to put out a statement in support of the court but was blocked from doing so for several days by the Hungarian government. Fellow diplomats explained that Budapest—a country located thousands of miles from the Philippines—was using its blocking power to curry favor with the Chinese government in the hope of attracting Chinese economic investments.

The danger inherent in Trump’s mercantilist policy is that he becomes the kind of general who wins every single battle—but ends up losing the war. At that point, America might well realize that for all the temporary benefits that “America first” might bring, its costs in the long run are unsustainable. Unfortunately, it then might be too late to pull the lost allies back into America’s camp.