The EU’s top court has ruled that Hungary’s arbitrary detention of asylum seekers in border zones is illegal.
The binding judgment came as EU politicians criticised Hungary’s state of emergency law, under which police have questioned more than 100 people over alleged coronavirus “fake news”.
Hungarian Prime Minister Viktor Orban refused to attend Thursday’s European Parliament debate on Hungary.
Nearly 300 people are held in transit zones on the Hungary-Serbia border.
The BBC’s Nick Thorpe in Budapest says the EU Court of Justice ruling paves the way for those asylum seekers – nearly half of them children – to be released, as the ECJ is ordering Hungary to devise new asylum rules.
Two families sued the nationalist Hungarian government at the ECJ, and they will have to be released, our correspondent says.
Of those detained in the two transit zones, 120 have spent more than a year there.
Hungarian troops patrol a barbed-wire fence on the southern border, erected to keep migrants out.
Erno Simon of the UN Refugee Agency (UNHCR) said the current situation in those transit zones was “completely unacceptable and inhuman”.
The Orban government refuses to accept asylum seekers from non-EU countries, resisting pressure from EU partners such as Italy and Greece for burden-sharing. The crisis triggered by a surge of migration in 2015 has still not been resolved, as many migrant camps are overcrowded and squalid.
Many MEPs voiced concern on Thursday over Mr Orban’s emergency law, passed on 30 March, granting him power to rule by decree indefinitely during the coronavirus crisis.
The law envisages prison terms of up to five years for “spreading false or misleading information before a broad public” about the virus or the authorities’ response to the pandemic.
EU Commission Vice-President Vera Jourova tweeted that “in Hungary, the emergency powers granted appear more extensive than in other member states” and “the Commission will be very vigilant on how emergency measures which affect democratic values are phased out in the member states”.