BERLIN — Chancellor Angela Merkel of Germany and her rebellious Bavarian interior minister reached a compromise Monday to end a dispute over immigration policies that threatened to bring down her coalition government.
Interior Minister Horst Seehofer, leader of the Christian Social Union party in Merkel’s coalition, said the compromise will ‘‘prevent the illegal immigration on the border between Germany and Austria.’’ He said he no longer intends to resign from the Cabinet.
The coalition’s third partner, the Social Democrats, will have to agree to any tightening on Germany’s border.
Seehofer had been in a standoff with Merkel over his plan to turn back at Germany’s borders any asylum-seekers who had registered in another European Union country.
Merkel rejected that plan, saying a solution that involves other European nations was needed.
“I think after a tough struggle and some difficult days we’ve found a really good compromise,” Merkel told reporters late Monday at her party’s headquarters. She said the deal establishes “transit centers” for asylum-seekers that are in line with the “spirit of partnership” across the European Union.
At a CSU meeting Sunday night, Seehofer offered his resignation as party leader and interior minister but was persuaded to resume negotiations with Merkel.
The clash between the chancellor and Seehofer, who is also the leader of the Bavarian conservatives in Merkel’s coalition, escalated late Sunday after eight hours of talks failed to resolve a standoff over the border policy, which would affect relatively few migrants but has become deeply political.
Although the stalemate has been broken for now, Merkel is weaker than she has ever been after nearly 13 years in office.
The first woman and the first easterner to run a reunified Germany, the chancellor is more than a beleaguered European leader who has stuck around for a little too long.
Celebrated as a standard-bearer of liberalism and the post-1989 world order for more than a decade, Merkel’s spectacular decline has now also become a symbol for the decline of the values she represented for so long.
Ever since she welcomed more than 1 million migrants, often in the country illegally, to Germany in 2015 and 2016, nationalism and populism have made a comeback in a country that has long tried to escape the shadows of its past.
Migration has become the topic that will most define her legacy and it has become a test for German democracy itself.
The number of new migrant arrivals are down to a small fraction of what they were. But the anti-immigrant far right has been gaining ground, nudging the entire political spectrum rightward — most strikingly, the Bavarian conservatives, who face state elections in October.
Seehofer, who was the premier of Bavaria when his state became the main gateway into Germany for migrants in 2015, had said he wanted Germany to block migrants at the border if they have no papers or have already registered in another European country.
Merkel, who has staked her legacy on upholding founding values of the European Union, like free movement across borders, insisted on a coordinated solution with neighboring governments. A hard border would almost certainly result in other countries reerecting checkpoints, too.
The two leaders, who share a long and difficult history, are on two sides of a much bigger clash of values currently playing out across the continent, ushering in a more fractured era in German politics.
In last September’s election, Merkel’s conservatives recorded their worst postwar result. It took two tries, negotiations with six other parties, nearly six months and a lot of concessions to political rivals to form a government.
In the vote, the far-right Alternative for Germany, or AfD, emerged as the third-strongest force in the German Parliament and the main opposition party.
Its rise has helped shrink the support base of the once mighty Social Democrats and opened a rift in Merkel’s Christian Democratic Union, or CDU, between those who stand by the chancellor’s liberal worldview and those who want her gone and yearn for a more traditional conservatism.
Seehofer and Merkel have had a strained relationship and have battled over migrant policy on and off since 2015.