Internal border checks must stay in place in Germany for as long as the EU fails to protect its external borders, newly-appointed German Interior Minister Horst Seehofer said, slamming the Schengen Agreement.

“As things stand now, there are not too many border points in Germany that are permanently occupied,” Seehofer told German weekly newspaper Die Welt am Sonntag.

“We will discuss whether that needs to change. After all, it is not just about preventing people from crossing borders illegally. Border controls also serve other protective functions.”

Seehofer lambasted the landmark Schengen Agreement, which allows border control-free travel within the passport-free Schengen zone, made up of 26 European nations.

“Internal border checks must be in place for as long as the EU fails to effectively protect and control the external borders,” the former Bavarian prime minister said. “At present, I don't see it succeeding in this in the near future."

Some blamed weak border control systems for allowing Anis Amri to stage the mid-December 2016 Christmas market attack in Berlin, which killed 12 people. Following the fatal attack, Amri managed to escape Germany first into France and then into Italy, where he was finally tracked down and killed in a shootout with Italian police in late December, 2016.

In September 2015, Germany became the first EU country to reintroduce internal controls. Back then, authorities opened checkpoints along the border with the neighboring Austria, to curb the flow of tens of thousands of refugees from the Middle East and North Africa. Border controls are also in place on flight connections from Greece.

Austria, Denmark, Sweden, Norway and France (which reintroduced border checks after a series of deadly terrorist attacks in November of 2015) followed in Germany’s footsteps. The five countries were later authorized to extend their temporal border controls until May 12, 2018. France will continue to conduct checks at the borders with the other Schengen zone states until late April.

The Schengen Borders Code allows member states to reintroduce border control at the internal borders for up to six months in the event of a “serious threat to public policy or internal security.”

The duration of such a measure is strictly limited in time, allowed to be extended up to a maximum of two years.

Seehofer made waves earlier this week when he said that “Islam doesn't belong to Germany.”

His stance is at odds with previous remarks from his own chancellor, Angela Merkel.

Merkel, who has faced backlash for agreeing to take in up to one million migrants, reaffirmed her view of a multi-ethnic Germany.

“There are now 4 million Muslims living in Germany and they practice their religion here and these Muslims belong to Germany, as does their religion – Islam,” she said on Friday.