Updated

German Chancellor Angela Markel on Monday balked on her signature immigration policies in a bid to stay in power, agreeing to create border camps for migrants and enforce tighter border control.

The German leader, under whose watch over a million migrants came into the country since 2015, was challenged by her rebellious Bavarian allies who threatened her to change the course of the nation or face the collapse of the delicate coalition government and therefore her leadership.

Interior Minister Horst Seehofer, leader of Merkel’s Bavarian-only sister party, emerged victorious on Monday, saying the compromise will “prevent the illegal immigration on the border between Germany and Austria.”

Seehofer had been in a showdown with the German Chancellor, offering his resignation on Sunday in protest over Merkel’s reluctance to accept his plans to reverse the country’s generous policies towards migrants.

“I won’t let myself be fired by a chancellor who is only chancellor because of me,” the minister told the Sueddeutsche Zeitung newspaper on Monday before the compromise was struck, noting that he was in an “inconceivable” situation

He urged Merkel to block asylum-seekers at the border if they have no identification papers or if they had already registered in another European country, The New York Times reported.

Merkel, who has become the key advocate of lax border control in Europe, was opposed to the plans, insisting a European-wide solution was needed to address the problem.

But she eventually struck a compromise with the government rebels in order to prevent the breakdown of the government and to remain in power.

Under the new policy, which is still pending approval of the Social Democrats, another party in Merkel’s delicate coalition, Germany would create so-called “transit centers” along the border.

All new migrants would have to be screened at the centers and determined if they are eligible to seek asylum in Germany. Any migrant who already applied for asylum in another European country would be rejected and asked to return to the countries where they made the applications.

Up until Monday, Merkel remained unabated defender of her approach to the migrant crisis rocking the continent. The public approval has been largely in favor of Merkel’s policies since 2015 but the support started to wane as the country began experiencing problems absorbing the new residents, the Times reported.

The disapproval was further exacerbated after a series of violent crimes, including rape, of German citizens by migrants and after the terrorist attack on a Christmas market in 2016 that left 12 people dead.

The Associated Press contributed to this report.