• Last month, Libya announced plans to shut down three of its biggest migration detention centres
Rwanda has agreed to take in hundreds of African migrants who are currently being held in Libyan detention centres.
A joint agreement between the government, the UN refugee agency (UNHRC) and the African Union (AU) was announced on Tuesday.
An initial group of 500 people will be evacuated by aeroplane to Rwanda in the coming weeks, a statement said.
That group, which includes children and vulnerable young people, is mainly made up of refugees from the Horn of Africa.
Thousands of migrants head to Libya each year to try and make the dangerous crossing over the Mediterranean Sea to reach Europe.
Those who fail are often held in detention centres. According to the UN, about 4,700 people urgently need to be moved to safety from these centres where conditions are said to be dire.
Rwanda made the offer to give refuge to the migrants in November 2017. It came after CNN released video that showed men in Libya being auctioned off as farm workers.
Germaine Kamayirese, Rwanda's minister of refugee affairs, denied that the country was being paid to take in the migrants.
"It is just a humanitarian action," she told reporters in the capital, Kigali. "Any African should aim to do the same. I don't agree with those who are saying Rwanda has received any money from anyone".
The policy of housing migrants within Africa is used by the European Union to stop migrants from arriving on its shores.
Camille Le Coz, from the Migration Policy Institute, told the BBC that a similar deal exists between the EU and Niger. Migrants are often held in Niger as they wait to be processed and granted passage to Europe.
In July, the UN called for the dismantling of all detention centres for refugees in Libya. It said the facilities were not fit to house migrants.
Detainees in various centres have described routine torture, rape, malnutrition and the spread of diseases like tuberculosis due to the conditions they are forced to endure.
Campaign group Amnesty International has called conditions "horrific" and "inhuman".
Last month, Libya announced plans to shut down three of its biggest migration detention centres in in Misrata, Tajoura and Khoms.
Organisations that monitor the situation in Libya fear these closures may lead to even more overcrowding in the remaining centres.