German Interior Minister Horst Seehofer has dropped his threat to resign after a compromise was reached in a migration dispute that threatened Merkel’s government.

“After intensive discussions between the CDU and CSU we have reached an agreement on how we can in future prevent illegal immigration on the border between Germany and Austria,” he told reporters in Berlin.

Seehofer after meeting Merkel’s Christian Democratic Union (CDU) said on Monday that the two conservative parties had tightened border controls he was demanding.

Merkel told journalists after the meeting that they had reached a deal and will create transit centres in the country from which migrants will be returned to countries they were in earlier.

The leader of the Bavarian Christian Social Union (CSU) had rejected a migration deal brokered in Brussels by Chancellor Angela Merkel and offered to step down from office.

Austria responded to the deal asking for clarification from Berlin and saying they were prepared to take measures to protect its borders.

“Should this agreement become the German government’s position, we see that as prompting us to take action to prevent negative consequences for Austria and its population,” Austrian Chancellor Sebastian Kurz said in a joint statement with two far-right cabinet members.

Merkel and Seehofer have been embroiled in a dispute for weeks over the interior minister’s plan to start turning away migrants at the German border with Austria who have already registered elsewhere in the European Union (EU).

On Friday, Merkel and the rest of the EU leaders hammered out a vaguely-worded deal to share out refugees on a voluntary basis and create “controlled centres” inside the bloc to process asylum requests.

The CSU’s hard line on migration comes amid a growth in support for the far-right Alternative for Germany (AfD) party in Bavaria, where state elections will be held in October.

Government scenarios

If the CSU had withdrawn its support for Merkel’s coalition, she would be left without a majority in the German parliament, possibly prompting fresh elections.

Last November, when Merkel was negotiating her fourth coalition, the long-time chancellor told German broadcaster ZDF she was “very sceptical” about leading a minority government and would rather call new elections.

Under the deal brokered in Brussels, EU leaders agreed to consider setting up “disembarkation platforms” outside the bloc, most likely in North Africa, in a bid to discourage migrants and refugees boarding EU-bound boats.

Member countries could also create processing centres to determine whether the new arrivals are returned home as economic migrants or admitted as refugees in willing states.

At the national level, Merkel proposes that migrants arriving in Germany who first registered in another EU country should be placed in special “admission centres” under restrictive conditions, according to a document she sent to the CSU and SPD.