German Chancellor Angela Merkel on Monday reached a deal with Interior Minister Horst Seehofer, who had threatened to resign on Sunday in protest against an immigration deal Merkel had proposed to other European Union leaders, The Guardian reported. This had raised questions about the future of Merkel’s government.

Seehofer – a member of the Christian Social Union party, an ally of Merkel’s Christian Democratic Union – had initially proposed an immediate rejection of immigrants registered in other European Union countries but later agreed to a phased implementation of the plan, contradicting Merkel’s stance on the matter.

The two sides hammered out “a good compromise…after a difficult struggle”, Merkel said after meeting Seehofer on Monday evening. The government would set up holding and processing centres for asylum seekers near German borders, she added.

“We have reached an agreement after very intense negotiations,” Seehofer said, emphasising that he would stay on in his Cabinet post. “We now have a clear agreement how to prevent illegal immigration across the Austrian-German border in future.”

The agreement still requires the approval of the Social Democrats, another coalition partner in the Merkel government. Alexander Dobrindt, the leader of the Christian Social Union’s parliamentary group, said “a common destiny proves its worth only when it is challenged”, BBC reported. He praised 70 years of unity between the two centre-right parties.