Hungary was a key transit country for people trekking along the western Balkan route to reach northern Europe, until it sealed its southern borders with razor-wire fence in October.

Thursday’s legal challenge coincided with the launch of a vitriolic media campaign against the quota scheme.

Government-sponsored messages appeared in national newspapers with the headline: “The quota increases the terror threat!” against a black background.

Other statements read: “An illegal immigrant arrives in Europe on average every 12 seconds”; “We don’t know who they are, or what their intentions are”; and “We don’t know how many hidden terrorists are among them”.

As part of the nationwide offensive, the government said it would also put up billboards bearing the slogan “Let’s defend the country” in the coming days.