The African Union (AU) has agreed to evacuate some 15,000 African migrants in Libya before the end of the year, the deputy chairman of the AU Commission, Kwesi Quartey, has tweeted.
The repatriations would be voluntary, and would be done in partnership with the International Organisation for Migration (IOM), he added.
At least 20,000 migrants are being held in government detention centres in Libya, Mr Quartey said.
The move follows reports that migrants are being sold in slave markets in the North African state, sparking global outrage.
An urgent evacuation plan for migrants in Libyan detention camps was drawn at an AU-EU summit in Ivory Coast last week.
Libya has undergone years of instability since rebels toppled former leader Col Muammar Gaddafi in 2011.
Two main factions control the oil-rich nation: a UN- backed government and a group led by a self-styled general.
Mr Quartey said the AU will work with member states to facilitate the evacuation and the “sustainable reintegration” of migrants into their communities: