The European Court of Human Rights (ECHR) has asked Poland and Latvia to help migrants trapped at their borders with Belarus.
Dozens of Iraqis and Afghans are stuck between the countries amid a political standoff between EU countries and Minsk.
Several nations in the east of the bloc claim Belarus is sending migrants towards their frontiers as revenge for EU sanctions, which were imposed following the crackdown on protests over a disputed presidential election.
Poland and Latvia are refusing to let dozens of migrants into their countries, while Belarus is not allowing them to return.
In a ruling, ECHR said: "The court decided [...] that the Polish and Latvian authorities provide all the applicants with food, water, clothing, adequate medical care and, if possible, temporary shelter.
"It clarified, at the same time, that this measure should not be understood as requiring that Poland or Latvia let the applicants enter their territories."