Margaret Besheer contributed to this report.
The U.N. refugee agency said 1,500 people are trapped in detention centers because of the Libyan conflict.
"The risks to their lives are growing by the hour. They must be urgently brought to safety. Simply put, this is a matter of life or death," U.N. High Commissioner for Refugees Filippo Grandi said in a statement Friday.
The agency said the migrants are "believed to be trapped in detention centers where hostilities are raging."
Since the conflict escalated last week, "more than 9,500 people have been forced to flee their homes," the U.N. refugee agency statement said.
Fighting continued Friday in the streets of Libya's capital, Tripoli.
The Reuters news agency reported that more than 1,000 people had gathered in central Tripoli to demand that Khalifa Haftar stop the advance of his Libyan National Army on the city.
Witnesses also reported an airstrike in Zuwara, west of Tripoli toward the Tunisian border.
Haftar launched his campaign a week ago, trying to take the capital from the internationally recognized administration of Prime Minister Fayez al-Serraj.
The United Nations is calling for a humanitarian truce to let emergency aid in and to give civilians a chance to get out. Secretary-General Antonio Guterres says there can be no military solution and that the parties must return to the political process.
The United States and European Union have called on Haftar's army to halt its offensive against the capital.
The fighting for control of Tripoli has left dozens of people dead, while al-Serraj's government says it has taken 200 prisoners.
Libya has been in political and economic chaos since longtime dictator Moammar Gadhafi was toppled and killed in 2011.