More than 16,000 African migrants have been repatriated from camps in Libya under an emergency plan, the EU’s foreign policy chief Federica Mogherini said Tuesday.

Italy and the European Union have been financing, training and providing other aid to Libya’s coastguard to stop smugglers from taking migrants in flimsy boats across the Mediterranean to Europe.

European and African leaders announced a plan for accelerated “voluntary” deportations in December after horrifying TV footage emerged of a slave market in Libya, where smugglers and criminal networks act with impunity.

Libyan detention camps for migrants were already notorious after reports of rape, torture and beatings at facilities under the control of the UN-backed government of Libyan Prime Minister Fayez al-Sarraj.

“In the first two months of this year, January and February, we managed to rescue and free more than 16,000 people from the camps in Libya,” Mogherini told the European Parliament in Strasbourg.

In the whole of 2017, 16,000 people were returned home from the camps and Mogherini said now only around 4,000 to 5,000 were left.

“I believe we can empty them completely within maximum (a) couple of months,” Mogherini said.

Lawless Libya, where rival militias, tribes and jihadists are vying for influence, is a major transit country for African migrants trying to reach Europe.

There has been a sharp decline in migrants arriving in Italy since the EU struck a controversial deal with Libya last year.