Germany’s Interior Minister Horst Seehofer says he will not resign, after hours of crisis talks with Chancellor Angela Merkel.
He said the two conservative parties in the governing coalition had agreed on how to prevent illegal migration across the border from Austria.
He had earlier threatened to quit but said tighter border controls had been agreed.
Mrs Merkel says a good compromise was found, Reuters news agency reports.
Mr Seehofer leads the Christian Social Union (CSU), the Bavarian sister party of Mrs Merkel’s Christian Democrats (CDU).
“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,” Mr Seehofer told reporters as he was leaving the CDU’s Berlin headquarters.
Mr Seehofer was demanding a right to turn irregular migrants away at Bavaria’s border but Mrs Merkel defended a deal reached with the EU.
They have agreed to a plan for so-called transit centers, from which people who have sought asylum in a different EU country can be sent back to their arrival point, if the other state agrees.