The U.N. refugee agency (UNHCR) reports 163 refugees from sub-Saharan Africa, who were detained in horrific conditions in Libya, have been flown out of the battle-scarred country to safety in Niger.

The plane landed in Niger’s capital, Niamey, early Friday. This was the first such flight out of Libya since fighting in the capital, Tripoli, escalated two weeks ago. The U.N. refugee agency reports the refugees aboard the plane had been detained in facilities close to the conflict frontlines.

UNHCR spokesman Babar Baloch said his agency was able to secure their release, along with that of more than 300 other refugees, within the past two weeks.

He told VOA the UNHCR is very concerned for the safety of some 3,000 refugees and migrants who remain trapped inside these facilities exposed to the escalating violence.

The refugees, he added, have fled persecution and violence from countries such as Eritrea, Mali, Nigeria, Sudan and Somalia.

“As fighting moves closer to these detention centers, the worry is these refugees could be very, very close to a situation of life and death,” he said. “That is why it is very important that we are able to secure the release of all those who are in those detention facilities and then trying to make sure that they are moved to a safe and secure location.”

The World Health Organization reports more than 200 people have been killed since clashes erupted two weeks ago when troops commanded by a rogue general moved to capture Tripoli.

The refugees who flew to Niger Friday include dozens of women and children. The UNHCR says it is urgently seeking states that will accept them and other refugees from previous flights for resettlement.

Since November 2017, the UNHCR has been able to relocate around 2,800 people from Libya to Niger. So far, places of resettlement have been found for nearly half of them. The rest remain in Niamey, waiting for a country willing to give them a home.