COPENHAGEN, Denmark (AP) — Sweden’s Prime Minister Stefan Lofven says border checks within the European Union won’t disappear “as long as order and security can’t be guaranteed.”

Systematic ID checks on every traveler are banned in the 26-nation passport-free travel zone known as the Schengen area. But Sweden, Austria, Denmark, Germany and non-EU country Norway received permission to introduce them in 2016 after more than 1 million migrants entered Europe the previous year, saying they are needed for security reasons.

Lofven says the identification checks at borders will continue “as long as we do not have a well-functioning system in the EU.”

He says the controls were “a necessary evil for some time.”

He spoke Thursday on his view for Europe’s future at the Uppsala University, 50 kilometers (31 miles) north of Stockholm.