The UN migration agency said on Monday it was trying to provide assistance to large numbers of migrants who had been held in the smuggling hub of Sabratha as rival factions battled for control of the city.
At least 4,000 migrants, including pregnant women, newborn babies and unaccompanied children, have been transferred from informal camps and dormitories to a hangar in the city since the clashes ended on Friday, the International Organization for Migration (IOM) said.
Sabratha has been the most common point of departure for mostly sub-Saharan African migrants trying to cross the Mediterranean by boat from Libya.
But the number of crossings dropped sharply in July after an armed group struck a deal with officials from the U.N.-backed government in Tripoli to block departures, under pressure from Italy and other European Union member states.
That set off three weeks of fighting among rival factions which ended with the withdrawal of the armed group. The migrants who have since been rounded up were being held at sites that the group had controlled, local officials said.
"We are seriously concerned by the large number of migrants caught up in recent developments in Sabratha," Othman Belbeisi, IOM Libya Chief of Mission, said in a statement.
Some migrants are being sent on to detention centres elsewhere in western Libya that are nominally under the control of the Tripoli government.
IOM officials say those centres, which were housing some 5,000 migrants, risk being overwhelmed by the new arrivals. Conditions in the centres are often dire and abuse widespread.
"Alternatives to detention must be found for migrants in Libya. In the meantime, IOM continues to provide direct humanitarian, health and psychosocial assistance to meet the urgent needs of the thousands of migrants being affected," Belbeisi said.
Local sources have previously said that an estimated 10,000 migrants were being held in the Sabratha area.
The head of Sabratha's department for countering illegal migration told Reuters on Saturday that help was urgently needed as some migrants had received no food or water for six days.