BERLIN — Chancellor Angela Merkel of Germany struggled to hold her fractious coalition together on Monday, after her Bavarian interior minister held off on a threat to step down over differences on how to secure the country’s borders against illegal migrants.
The clash between the chancellor and Horst Seehofer, her interior minister and the leader of the Bavarian party Christian Social Union, swelled into a full-blown political crisis late Sunday, after eight hours of talks failed to resolve a stalemate on how to ensure that the arrival of more than one million mostly undocumented migrants in 2015 is not repeated.
Mr. Seehofer was expected to meet the chancellor in Berlin later Monday, in a last-ditch effort to reach a compromise, although a similar meeting at the chancellery on Saturday failed to produce any results. But failure to reach an agreement could prompt Mr. Seehofer’s party to leave Ms. Merkel’s fractious coalition, spelling the end of her government and destroying the longstanding alliance between her conservative Christian Democratic Union and the Bavarian conservatives.
After retreating for the night on Sunday, both conservative parties sounded more conciliatory tones.
Mr. Seehofer said he had offered to resign as both interior minister and party leader.
That would free Ms. Merkel of a partnership with one of her fiercest critics, and would force Mr. Seehofer and his party to make a difficult choice. The Bavarian conservatives could remain in government without him, keeping Ms. Merkel’s coalition intact and forcing the Bavarian party to recognize its role as a junior partner. Or Mr. Seehofer could pull his party out of the coalition with him, breaking a political alliance that has formed Germany’s conservative backbone for the past seven decades.
Mr. Seehofer wants Germany to block migrants at the border if they have no papers, or have already registered in another European country, a move that would increase friction in the European Union at a time when Ms. Merkel is trying to negotiate a migration policy across the entire bloc. Barring access to Germany would increase the burden on countries to the south, where the vast majority of migrants enter Europe, and would defy the bloc’s policy on open borders among its members.
Appearing before reporters after the marathon meeting on Sunday with his party’s leadership, Mr. Seehofer said he would to try yet again to reach a compromise with the chancellor, emphasizing the importance of the government over his party’s interests.
“In the interest of this country, the government’s ability to act and of the governing coalition, which we would like to maintain,” he said, “we would like to try to reach an agreement on this central question of border control and rejections at the border.”
In Berlin, the leadership of the chancellor’s Christian Democrats also expressed a willingness to compromise in the hopes of holding together a government that is needed to address pressing issues regarding a national budget, health care, housing and digital infrastructure.
“We would like to see agreement on a joint way forward,” the Christian Democrats said in a statement after their own leadership meeting. “We share a common goal in migration policy. We want to order, control and limit migration to Germany.”
If the parties fail to reach a compromise, and the Bavarian party decides to quit the coalition, the chancellor could turn to the environmentalist Greens party for support.
Robert Habeck, leader of the Greens, said that his party would consider joining a new government, but that it would not simply step into a vacuum left by the Bavarians. Instead, they would seek to negotiate a new coalition agreement, consequently ruling out tolerating a minority government under Ms. Merkel.
“We are always ready to accept responsibility if it is worth it,” Mr. Habeck said in an interview on the public broadcaster ZDF. “We can’t rule out anything in these crazy times.”
But such a process would leave Germany without a functioning government at a time it is needed on the international stage, as Europe struggles to deal with the fallout of Britain’s decision to withdraw from the European Union, and as the Trump administration threatens to escalate a trade dispute. But migration has emerged as a dominant, increasingly toxic issue in German politics.
Since Ms. Merkel’s decision to welcome more than a million people in 2015, immigration has been considered the topic that would most define her legacy. But it has also become a test for German democracy itself.
The anti-immigration party Alternative for Germany, or AfD, emerged from the September election as the third-strongest force in the German Parliament and the main opposition party.
The migration issue has helped shrink the support base of the once-mighty Social Democrats, and it has opened a rift inside Ms. Merkel’s own Christian Democrats, or C.D.U., between those who stand by her liberal worldview and those who want her gone and yearn for a more traditional conservatism.
Such divisions were carefully hidden in a statement the party’s leader, Annegret Kramp-Karrenbauer, read late Sunday as the party waited for word from Munich about the fate of their coalition and their government.
“The goal of the C.D.U. is to better order, control and limit migration to Germany,” the statement read. “At the same time, for us it is clear that we need viable, humane solutions, together with our European partners.”
Above all, the AfD’s rise has sharply shifted the powerful and already very conservative state of Bavaria to the right, and with it the entire political spectrum, analysts say. Mr. Seehofer’s tough stand on migrants is seen in part as a bid to protect his party’s right flank before state elections in October.
But as Ursula Münch, a political scientist with the Academy for Political Education in Tutzing, points out, the Bavarian party may have miscalculated, hoping to garner more support for their hard-line approach to migration from within Ms. Merkel’s party.
“Exactly the opposite has happened,” Ms. Münch said. “There are a couple of critical voices within the Christian Democrats, but largely they have shown solidarity with the chancellor.”
The latest polls also indicate that Bavarians are growing increasingly tired of the sniping taking place in Berlin. Surveys carried out in the past week showed the Christian Social Union dropping in popularity, with the latest poll by Forsa showing them with 34 percent support, compared with 48 percent in state elections in 2013.