German Chancellor Angela Merkel will soon be out of power in Germany. She leaves behind a country divided by populist pressure and a fractured Europe fueled by xenophobia. As contenders vie for her power, the increasingly authoritarian governments of Hungary, along with the Czech Republic, Poland, and Slovakia, demonstrate one path forward — one that Merkel’s successor should be keen to avoid.

Merkel’s announcement comes amid political setbacks for her center-right Christian Democratic Union party. In recent elections in both Hesse and Bavaria, the current ruling coalition lost badly, signaling a loss of confidence among the electorate.

This lack of confidence makes clear what critics have long foretold: It’s time for new leadership in Germany. Merkel bred frustration by failing to reinvest tax dollars in much-needed infrastructure, she made promises on environmental issues that weren’t kept, and, perhaps most important for her far-right critics, she failed to manage immigration. After allowing more than 1.2 million asylum seekers into the country in 2015 and 2016, Merkel also failed to ensure that German bureaucracy, police, and communities could absorb the added population.

These issues, of course, are not unique to Germany, but they have sparked tension across Europe and populist backlash. Perhaps the best example of this is in Hungary, where Prime Minster Viktor Orban, who swept to power on anti-immigrant sentiment, moved for a radical overhaul of the country’s constitution.

He has largely been successful. And Hungary, once a good example of post-Soviet democracy, now resembles an increasingly autocratic state with crony capitalism and far-right rhetoric blended into a single-party political culture. Orban, in his demand for closed borders and an end to immigration, vilified Merkel, arguing that her policy of accepting immigrants was the source of European trouble.

For Orban, that rhetoric worked not only to propel him to victory with the clout necessary to solidify his own power that has enabled such undemocratic ends as curtailing academic freedom, state control of media, and undermining the rule of law. But he has also pulled other European Union states in a similar direction. Now, the Czech Republic, Poland, and Slovakia, all riding on rekindled nationalist anger, have pulled away from European unity and increasingly pivoted towards autocratic regimes.

Elsewhere, including Austria, France, and Denmark, Orban has found supporters employing a similar message, and, while not yet in power, they are riding the tide of nationalist, anti-immigrant rhetoric.

Now, with Merkel setting the stage for her political exit, Germany and the European Union are poised to lose the staunchest defender of the post-Cold War order that has paved the way for stability and increasing prosperity in Europe.

Indeed, while Merkel and her allies lost support in recent polls, the far-right Alternative for Germany party has been gaining ground. The AfD, founded in 2013, has rapidly grown to be the third-largest party in the country.

Like similar parties throughout the West, AfD has openly aligned itself with nationalism and populist, anti-immigrant, Islamophobic, and anti-Semitic rhetoric.

Additionally, AfD has increasingly found support among extremist groups, such as Pegida, an acronym for the ominously named Patriotic Europeans Against the Islamization of the Occident. Pegida, founded in 2014, is openly anti-immigrant and anti-Muslim and anti-Semitic.

On the Left, the centrist party has lost ground to the Greens, making finding common ground and unifying political leadership more difficult. The result is increasingly powerful factions intently at odds with each other, not just in Germany but within the European Union.

Soon to be without the strongest center anchor at the head of Germany’s strong economy, the unity of the EU seems increasingly tenuous, jeopardizing post-war and post-Soviet stability.

Not only does the specter of instability spell economic chaos, but it also leaves Europe less unified against the formidable threat posed by Russia. That plays into Moscow’s hands, paving the way for the disunity that Putin has sought to promote with disinformation campaigns and even arms in Ukraine.

If Europe is to maintain its stability and prosperity, Merkel’s successor, in both Germany and as a leader in the EU, must not bend towards the AfD and the nationalist rhetoric of Hungary and instead look to Merkel’s efforts for compromise while learning from her mistakes.