Wolfgang Rattay / Reuters

Why was Angela Merkel just elected to a fourth term as German chancellor? Ahead of Sunday’s election, the German journalist Robin Alexander offered one explanation. Since the economy is thriving and the nation’s politics are relatively placid despite the disruptive rise of a far-right populist-nationalist party, many Germans think they’re living on a “ship of stability and around us it’s very stormy.” Consider: Vladimir Putin changed Ukraine’s borders by force; Donald Trump, who “in German eyes behaves like a madman,” was elected president of the United States; Britain voted to exit the European Union; and France, had Marine Le Pen won this year’s presidential race, might have left the bloc as well, destroying the entire EU project.

If you’re caught up in such a storm, Alexander asked me, “do you change the captain?”

Now, however, the question is where the captain will steer the tempest-tossed ship. Earlier this year, Merkel famously declared that “the times in which we could completely depend on” allies like the United States and the United Kingdom “are on the way out.” In the coming years, Merkel’s government could demonstrate what it means for Germans and Europeans more broadly to, as she put it, “take our fate into our own hands.”

In Germany, said Jana Puglierin of the German Council on Foreign Relations, “we very often say Trump and Brexit in the same sentence” because the developments shook the two pillars of German foreign policy since the mid-20th century: the U.S.-German alliance and the European Union. “The two nations which did the most to make Europe whole and free again after ’45 and stand for the tradition of liberalism and democracy, they turned their back to alliances and took a nationalistic orientation,” Puglierin explained.

The United States has served as a model for German democracy and as a guarantor of German security, both through NATO and America’s nuclear-weapons arsenal. The European Union has allowed Germany to become a leading power in Europe while maintaining good relations with its neighbors—as Puglierin put it, “to breathe and to feel well in our own shoes.” In Brexit, the EU will lose its second-largest economy and its strongest link to the United States. In Trump, Germans have confronted a leader across the Atlantic who has wavered on defending NATO members, demanded that Germany pay more for U.S. military protection, challenged certain aspects of liberal democracy, championed the very nationalism that European integration was designed to transcend, and dismissed the EU as a “vehicle” for German power. At first, after the one-two punch of Brexit andTrump, Germans had “the impression that our world crumbled,” Puglierin said.

That initial impression was overblown; so far, the European Union has absorbed the shock of Britain’s departure and Trump has backed away from many of his threats to German interests. But Germany is still struggling to find its place in a world where old certainties are now in question.

In a telling debate before the German election, representatives of the country’s six main parties were asked which of four nations—the United States, the United Kingdom, Russia, and Turkey—was Germany’s closest partner. Two chose the U.K. in a show of European solidarity. Two picked the U.S. because transatlantic relations were most important, though they explicitly excluded Donald Trump, the “outrageous U.S. president” who “is insulting the whole world and endangering the world with his tweets,” from the partnership. One—the emissary from Merkel’s party—wondered why he couldn’t pick France. Another made no selection whatsoever. When the moderator asked whether any audience members thought Trump was a “reliable partner for Germany,” two lonely hands went up.

Germany is in a particularly tough spot when it comes to its relations with the United States. As was evident in the run-up to this weekend’s election—during which Merkel’s main opponent campaigned on full-throated opposition to Trump and Merkel issued more subdued criticisms of the American president’s isolationism and threats of war with North Korea—anti-Americanism, or at least anti-Trumpism, is popular in Germany, as it is elsewhere in Western Europe. A mere 11 percent of Germans express confidence in Trump, down from 86 percent who had confidence in Barack Obama in 2016. Most Germans disapprove of everything from Trump’s retreat from free trade to his threats to scrap the nuclear deal with Iran. (There are exceptions: Alexander Gauland, a leader of the far-right Alternative for Germany, which finished third in the election and will now enter the German parliament for the first time, recently told me that he sees echoes of his own policy agenda in Trump’s “Muslim ban” and pledge to put his country’s interests “first.”)

But no policy has generated more hostility than the U.S. withdrawal from the Paris climate-change agreement. “The president, in this instance, gave [priority] to his domestic agenda over the ambition to display American leadership on the international stage,” Peter Wittig, the German ambassador to the United States, told me in an interview this summer. In Europe, “there’s a fear out there that America is wittingly or willingly embarking on a tectonic shift in our configuration in the world by leaving a vacuum, by tolerating a vacuum” wherein China is “posing as the standard-bearer of free trade, posing as the greatest protector of the global climate.”

And yet while China is now Germany’s largest trading partner and a top ally in combating climate change, it is “not a like-minded partner” in that it does not share Germany’s values, Wittig noted. Germans “are fully aware that we cannot and don’t want to” substitute the U.S. alliance for an alliance with China, the ambassador explained. “There is no alternative to the transatlantic relationship for us.”

As for whether the current occupant of the White House is bound to these values, “many people in Germany … would doubt that—whether the leadership of [the United States] still shares entirely the same values,” Wittig said. But he himself “wouldn’t go that far,” because those values—liberal democracy, rule of law, human rights—are “part and parcel” of American society. (It’s a lesson to the world “when the acting attorney general, being a member of the executive, appoints a special investigator who potentially investigates against the president,” Wittig told me. “If that is not a constitutional strength, [along with] checks and balances, I don’t know what is. This is, in a way, a model of a rule-of-law country.”)

Just as German leaders aren’t prepared to cut loose the United States, they’re also unwilling to embrace the role that some critics of Trump’s America have assigned to the country: that of the new “leader of the free world.” When I asked Puglierin whether the title was appropriate, she laughed. “I mean, with which army?” she asked. Merkel has vowed to gradually meet a NATO target of spending at least 2 percent of Germany’s gross domestic product on defense. But she’ll likely encounter great resistance in reaching that goal—both because of Germans’ post-World War II aversion to military buildups and the use of force to resolve conflict, and because many Germans don’t want to comply with a demand they feel is coming not from NATO but from a money-grubbing American president.

Merkel has repeatedly defended values associated with the “free world,” inserted her government into international efforts to address climate change and curb nuclear proliferation in Iran and North Korea, and led the response to Europe’s debt and refugee crises. But Germany is “not aspiring to be a global power,” Wittig insisted. It is, rather, a “medium-sized power” and a “leading power in Europe.”

If Germany isn’t interested in remaking its place in the world—by turning away from the United States and toward world powers like China, or by becoming a global power in its own right—that leaves the country with two wobbly but familiar pillars: Europe and America.

At the moment, Merkel’s priority appears to be strengthening the Europe pillar by boosting the EU’s economic competitiveness and cooperation among the 27 nations that will remain in the bloc once Britain leaves. It’s a comfortable role for postwar Germany, which has preferred to lead through multilateral institutions rather than alone. Merkel and Emmanuel Macron, the new pro-EU president of France, have indicated that they’ll pursue several reforms—pooling European defense resources, establishing a European Monetary Fund, creating a eurozone finance minister and budget—though political opposition at home and elsewhere in the European Union could stifle their ambitions. The EU may also accelerate long-contemplated free-trade deals with other economic powers. Operating through the European Union, Germany could seek out allies such as Australia, Canada, and Japan that share Germany’s interest “in this liberal international order—in ... open and free markets, in globalization,” Puglierin said.

As for Trump-era America, Merkel’s strategy seems to be to weather the storm, just as Germany has overcome previous bouts of volatility in its decades-old alliance with the United States. “The transatlantic relationship is bigger and much more important than” Trump’s presidency, Puglierin argued.It’s not about abandoning [the relationship]. It’s just about trying to survive this period without totally losing the United States.”

Wittig acknowledged that the turmoil and polarization of contemporary American politics could weaken the United States and, by extension, Germany and other U.S. allies. “You want to have a leader of the free world that is not … sucked up by a domestic, permanent struggle,” he noted. “The more this presidency is captured and oxygen is sucked out by domestic challenges, the less it can devote time and energy and leadership to the problems of the world.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.