A staunch opponent of Chancellor Angela Merkel's response to the 2010s migrant crisis, Seehofer threatened to file a formal complaint with the Constitutional Court, with the historic CDU/CSU alliance in danger of splitting and running against each other in the whole of Germany for the first time, but neither happened. He is a proponent of a federal cap on the number of refugees the German government is to take in. After faring historically badly in the 2017 federal election with a campaign that was criticised for mimicking the Alternative for Germany, the party receiving its worst result since 1949, and unsuccessfully trying to run for a third term as Minister President in 2018, he was pressured by his party to resign and instead decided to take the office of Minister of the Interior, Building and Community (originally intended for Joachim Herrmann) in Merkel's fourth government, in order to shape the migrant policy after his views. In July 2018, a week-long dissent between Seehofer and Merkel nearly brought down the government and again seriously threatened a CDU/CSU split, but they ultimately found a compromise.