Some 6,000 people are detained in centres under the control of the Tripoli-based government [File: Hani Amara/Reuters]
As fighting between rival forces rages on the outskirts of the Libyan capital, thousands of refugees and migrants locked up in detention centres inside Tripoli say they are terrified of what might happen to them.
Renegade General Khalifa Haftar on Thursday ordered his self-styled Libyan National Army (LNA), which is allied to a parallel administration in the east, to march on Tripoli, the seat of the country's internationally recognised government which is protected by an array of militias.
Despite international calls for a truce, clashes have intensified, with dozens of people killed on both sides since the fighting began.
In recent days, Al Jazeera contacted detainees in several migrant detention centres across Tripoli. The detainees, who use hidden phones to communicate, asked that their names not be published for fear of retaliation. Some of the detention centres are also not named to protect the detainees' identities. Their statements could not be independently verified, but they offered similar accounts.
Some of the refugees and migrants said they had been left without food or water, including hundreds in the middle of an active conflict zone. Others said they had been taken from their cells and forced to move weapons.
"We can see the military," said a man in Qasr bin Ghashir detention centre, on the southern outskirts of Tripoli, in an area where clashes are ongoing.
Speaking to Al Jazeera on Sunday, he said hundreds of refugees and migrants being held there had not had any food in two days.
"The food store is empty," he said. "The war is still continuing. Even the electricity and water supply stopped."
Two men wearing military outfits reportedly arrived to tell Qasr bin Ghashir's detainees, including children, they would be moved to a safe place - but those being held there were worried the men were traffickers or smugglers who might take them for ransom.
"Maybe they'll take us to sell us," said one man, who sent recordings in which loud explosions could be heard.
"All people are crazy. We're in a bad situation now, but we don't know where we can go," he added. "All the people want to run away from here. We are very stressed now. Already our mind is losing hope."
In Ain Zara detention centre, southeast of Tripoli, a detainee said most of the guards in charge of them had left and food had run out. During another outbreak of conflict in August last year, more than 400 men, women, and children were abandoned in Ain Zara after the Libyans guarding them ran away.
In a Twitter post on Sunday, the UN refugee agency (UNHCR) said it was "very concerned" about the situation in Ain Zara and Qasr bin Ghashir, where there were ongoing clashes.
#UNHCR remains concerned about developments in Libya & calls for safe, unimpeded and sustained humanitarian access to all affected areas. UNHCR team remains on the ground responding to situation of IDPs & refugees @Refugees
A detainee at a Tripoli detention centre said dozens of male refugees and migrants had been taken out of a big hall, where they are being held, to carry and load weapons.
In return for working in a nearby military headquarters, they may be given bread and vegetables, or cigarettes, though the detainee reiterated they do not have much choice about whether they go. "(The guards) use force in everything," he said.
In another centre in southern Tripoli, refugees were concerned about what might happen if Haftar took over - and whether they would be treated better or worse.
"The situation is quite weird. There are no police around. We are all so terrified," said one man, before asking whether he would be safer if he tried to escape onto the streets.
Around 15,000 refugees and migrants were returned to Libya last year alone, under a two-year-old deal in which the European Union supports the Libyan coastguard with funds, ships and training, in return for carrying out interceptions and rescues.
The UN continues to reiterate that Libya is not a safe country to return refugees and migrants to.
Last week, the International Organisation for Migration released a statement saying the country "cannot be considered a safe port or haven for migrants".
"The security and humanitarian situations in the country remain dangerous."