Hungary will detain all illegal migrants until their asylum applications have been processed, says János Lázár, who heads the office of Prime Minister Viktor Orbán.

At present, migrants are housed in open camps and able to roam the country unopposed while their cases are heard. Moves towards a system of automatic detention set the scene for a showdown with the European Union (EU), which does not allow its member-states to implement comprehensive security measures.

The bloc’s recast Reception Conditions Directive states that asylum seekers must be allowed to “move freely”, with detention permitted only in exceptional circumstances.

“Automatic detention for the full length of the asylum procedure is absolutely not in accordance with EU law or [European Court of Human Rights] case law,” complained Márta Pardavi, Co-Chair of the Hungarian Helsinki Committee, which assists migrants.

The committee is one of the controversial NGOs, funded by billionaire financier and open borders advocate George Soros, which Prime Minister Orbán has pledged to “sweep away”.

Hungary cited increased pressure on the country’s borders and a heightened terror risk as the justification for detaining migrants while their claims are processed.

Last month Anis Amri, a failed asylum seeker in Germany, awaiting deportation to Tunisia, murdered a Polish haulier, hijacked his lorry, and drove it into a Christmas market in Berlin. Twelve people were killed, with another 48 injured.

Amri was then able to escape into the borderless Schengen Area, travelling through several EU countries before Italian police discovered him by chance at a random stop-and-search. Amri shot one of the policemen who stopped him in the ensuing gunfight but was then shot and killed himself by rookie officer Luca Scatà.

The closest the UK has come to implementing strict rules for illegal migrants, who enter the country through the Channel Tunnel, “porous” maritime borders, and “defenceless” airfields, was with the proposed Illegal Immigrants (Criminal Sanctions) Bill.

Sir Edward Leigh, who supported the bill, said that people could not understand why illegal migrants, “having caused massive, criminal disruption”, apparently face “no consequences” for their actions.

“They are not even returned, it seems, to France.”

The minister then responsible for refugees, Richard Harrington, told Sir Edward that EU regulations make it impossible to send most illegal migrants back to France.

The bill was withdrawn in March 2016, and will make no further progress.