German Chancellor Angela Merkel pictured at the European Union leaders summit in Brussels on June 29, 2018. Francois Lenoir / Reuters

“The beginning of the end of Angela Merkel as chancellor,” read one headline. “Imagining a post-Merkel Europe,” read another. They might have been written yesterday, before Merkel struck a last-minute migration deal to save her government from possible collapse. But they were published back in November—the last time German Chancellor Angela Merkel faced her own downfall, and then escaped it.

At issue then was the 13-year chancellor’s struggle to form a new government following the country’s September general election, in which the vote fractured among numerous political parties, making it nearly impossible to form a coalition. (The outcome ultimately left Merkel in charge, but drastically weakened—the German newspaper Bild dubbed it a “nightmare victory.”) This time, the crisis revolved around a rogue Cabinet minister, coalition infighting, and a fierce debate about how Germany—and the rest of Europe—should deal with asylum-seekers at its border.

And once again, Merkel has proven herself an uncanny crisis-weathering survivor. The chancellor reached a last-ditch agreement Monday night after her own interior minister, Horst Seehofer, staged an insurrection over migration that threatened to bring her government down. The deal marks the tentative end to a weeks-long dispute that began last month, when Seehofer began threatening, in defiance of Merkel, to start turning asylum-seekers who have first sought asylum in another EU country away at the German border. Seehofer also happens to be the leader of the CSU, a center-right party in the German state of Bavaria which has been allied with what’s now Merkel’s conservative party since 1949. The two parties have endured spats like this for decades and have always ultimately decided to stick together, though this one may have been a new low in the relationship.

Under the terms of the agreement, migrants seeking refuge in Germany who have already been registered in other EU countries will not be turned back at the border automatically, but would instead be housed in transit centers along Germany’s southern border with Austria. From there, Germany plans to send rejected asylum-seekers back to the countries from which they first arrived in the EU (pending deals with those countries). Rejected asylum-seekers who are registered with countries where no such deal exists, the agreement says, will be turned back to Austria (this part would require a to-be-negotiated deal with Vienna).

Merkel called the deal a “good compromise,” and Seehofer, who less than a day before had threatened to resign over the dispute, confirmed that he was “very satisfied” with the agreement. But if the deal seems to have resolved the immediate fight with Seehofer, it has only introduced another set of problems. For one thing, there is no indication that Austria will go for it. The Austrian government warned in a statement Tuesday that any effort by Berlin to turning back people at its border would force Austria to do the same, with Austrian Chancellor Sebastian Kurz warning darkly of a “domino effect” that could hasten the collapse of the EU’s internal open-borders system. It was this kind of scenario that prompted Merkel’s opposition to Seehofer’s original plan in the first place.

Then there’s Italy. Although the largest number of so-called “secondary migrants” to Germany come from Italy, Rome’s new right-wing government has signaled that it will not accept more asylum-seekers—especially from EU countries it has already criticized for not doing enough to share its burden in the migrant crisis.

So while Seehofer’s proposal was disliked within Germany by liberals on migration like Merkel, who have been aiming to find a way to welcome refugees to Germany, it was opposed outside Germany by immigration hardliners, who don’t want to see Germany sending asylum-seekers to their own countries. Gerald Knaus, the founding chairman of the Berlin-based European Stability Initiative think thank, told me that in addition to Italy, Seehofer’s initial proposal was unpalatable to anti-migrant governments Hungary and Austria as well. “On substance, it suddenly turns out that it’s actually impossible to control a border unilaterally if your neighbors don’t agree.”

There’s also the matter of the German government’s third coalition partner, the Social Democrats. Though largely absent from this latest round of coalition infighting, the party rejected the idea of establishing transit zones when Merkel first suggested it three years ago, and appears to be maintaining its position now. The party called into question on Tuesday the need for such transition centers, noting that unlike three years ago, the number of refugees coming to Germany’s borders has been significantly reduced. But that may be the sum total of the party’s opposition: Its political power considerably weakened following the country’s last general election, it’s unlikely to risk reigniting yet another crisis within the governing coalition.

It’s a flawed, awkward deal—which is also what makes it somewhat typical of Merkel and her secret to outflanking opponents and holding on to power. Again and again, she has managed to cobble together patchwork coalitions and interim deals that satisfy enough of the people enough of the time to preserve her chancellorship until the next crisis, when she’ll do it all again. Importantly, the deal also allows Seehofer—who will not only get to claim credit for achieving at least some of his demands at the German border, but will also retain his role within Merkel’s cabinet—to save face. The CSU faces elections in Bavaria in a few short months, and the party faces a threat from the far-right, anti-migrant Alternative for Germany (AfD). Seehofer seemed determined to prove that his party could be tough on migration, too. As The New York Times reported, Bavaria received tens of thousands of arrivals along its 500-mile border with Austria at the height of the refugee crisis. Though these numbers have fallen considerably since, it proved enough for a party like the AfD to gain popularity, leaving the CSU struggling to defend its foothold in the state.

Despite the agreement, the Seehofer’s efforts may have already backfired. Polling Monday showed that 67 percent of Germans considered the CSU’s asylum fight “irresponsible,” with the majority of CSU voters saying they disagree with their own party’s leadership. On the other hand, if the CSU wanted more support from the right, it may have got it—it is only among AfD voters that the CSU received overwhelming support (85 percent) for the standoff. “The CSU is acting against its own strategic interest,” Leopold Traugott, a policy analyst at the London-based think tank Open Europe, told me ahead of Monday night’s deal. “The majority of German citizens, including Bavarian citizens, think the CSU is going too hard on this one.” In the end, he added, it could also strengthen Merkel’s hand.  

It was on this that Knaus agreed. “Merkel has certainly emerged stronger from this once again than her CSU critics,” he said, adding: “She could now actually propose a functioning system for European border and asylum policy. If she does that with allies in Europe, she will emerge strengthened from this.”

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