The UN has called for the dismantling of all detention centres for refugees in Libya, saying the facilities are not fit to house migrants.
The appeal comes nearly two weeks after more than 50 people were killed in an air strike on a holding facility in the Libyan capital Tripoli.
The victims were mostly Africans attempting to reach Europe on boats after fleeing poverty and conflict.
The UN refugee agency has called the facilities in the centres “awful”.
Thousands of migrants are being held in dire conditions in government-run detention centres across Libya.
The recent air strike on one of them during fighting in Tripoli has revealed how dangerous these facilities can be.
The UN refugee agency said the centres should be dismantled immediately, and their detainees freed into their surrounding communities. The agency said it is ready to help support them there.
The UN has been critical of European policies that favour returning to Libya migrants who are rescued at sea, stating that the country isn’t safe for them.
Some 120 migrants were inside a hangar at the Tajoura Detention Centre when it was hit on 3 July, with women and children among the 50 fatalities.