African migrants sit in a packed room with their beds and blankets at the Tariq Al-Matar detention center on the outskirts of the Libyan capital Tripoli on Monday. (Taha Jawashi/AFP/Getty Images)

African and European leaders concluded a summit in the Ivory Coast on Wednesday that was meant to focus on economic cooperation but was largely overshadowed by furor over the ongoing exploitation of African migrants en route to Europe in Libya.

A recent CNN report provided video evidence of what human rights organizations and aid agencies have been warning for years: In addition to facing utterly dismal conditions in Libyan detention camps, migrants are being bought and sold as slaves.

Late on Wednesday, the leaders of Libya, France, Germany, Chad, Niger and four other countries agreed to attempt a massive and imminent evacuation of migrants who are trapped in the camps. Most would be taken back to their home countries, according to the agreement. A night earlier, Libyan authorities in conjunction with the United Nations' refugee agency flew 240 Nigerians back to their country of origin.

One of the African Union's top officials, Moussa Faki Mahamat, told the gathered leaders that by his organization's estimates, there could be anywhere between 400,000 to 700,000 African migrants stuck in Libya against their will. The plans drafted Wednesday indicate that the first evacuation push will target 3,800 migrants.

Migrants, mostly from West African countries, transit through Libya in hopes of embarking from its shores on often flimsy boats intended to deliver them to Europe, but they often capsize or are turned back by the Libyan coast guard. Thousands drown each year. They are mostly escaping conflict and grinding poverty in their home countries.

Libya, which has not had a unified national government since its longtime leader Moammar Gaddafi was deposed in 2011, has been accused of abetting a growing slave trade by refusing outside access to the camps and for not cracking down on the trade's operatives. But recent changes in the European Union's migration policies have also attracted withering criticism for their role in trapping migrants in lawless Libya.

In an effort to stop migrants before they ever reach Europe, the European Union has begun paying African authorities, especially in Niger and Libya, to detain migrants. Instead of stemming their flow, it has forced migrants to travel along more dangerous smuggling routes and has swollen the number of people stuck in Libya, one leg away from their journey's hoped-for end. After the CNN report, demonstrators took to the streets in Paris, Stockholm and New York shouting slogans such as “Free our brothers!”

Still, much of the anger from African leaders was directed at Libya.

“Some Nigerians [in the footage] were being sold like goats for few dollars in Libya,” said Nigerian president Muhammadu Buhari on Tuesday at the summit. ''After 43 years of Gaddafi . . . all [Libyans] learned was how to shoot and kill. They didn't learn to be electricians, plumbers or any other trade.”

Burkina Faso’s foreign affairs minister recalled his ambassador from Libya last week, calling it “unacceptable to have slaves in this 21st century.”

French President Emmanuel Macron said Libya was intent on cooperating. “Libya restated its agreement to identify the camps where scenes of barbarism have been identified,” he said.

Before Gaddafi's fall, Libya drew West African migrants who intended to stay there and work in its lucrative oil and agricultural industries. But the civil war that followed his overthrow has destroyed those opportunities and created a power vacuum in which militias are vying for power. Many have taken to the smuggling and slavery trades as ways to make money.

Part of Wednesday's agreement, according to Macron is that the African Union, European Union and United Nations will work together to freeze the assets of human traffickers, some of whom may be referable to the International Criminal Court.

Ultimately, only the summit's original focus — the boosting of economic development in Africa — will result in reduced migration. Stopgap measures like evacuations have little to do with the crisis's underlying causes. Many who are returned to their home countries will likely be relieved to have escaped slavery or rotten conditions in detention camps, but returning to a life of squalor may not prevent them from trying to migrate again.

Read More:

A ‘slave auction’ puts the global spotlight back on Libya

A ‘ghost ship’ washed ashore in Japan, and clues point to North Koreans

Mass evictions in freezing Beijing winter sparks public outrage but little official remorse