European governments are “complicit” in grave human rights violations in Libya through their support for authorities there that often work with people smugglers and torture refugees and migrants, Amnesty International said on Tuesday.

Determined to cut African immigration across the Mediterranean, the governments, via the European Union, have provided support to Libya, trained its coast guard and spent millions of euros through U.N. agencies to improve conditions in detention camps where Libya puts the migrants.

The advocacy group said up to 20,000 people were now held in these centers and subject to “torture, forced labor, extortion, and unlawful killings,” adding to similar allegations made by other rights organizations over the past months.

“European governments have not just been fully aware of these abuses; by actively supporting the Libyan authorities in stopping sea crossings and containing people in Libya, they are complicit in these crimes,” said John Dalhuisen, Amnesty International’s head for Europe.

The European Union’s executive arm, the European Commission, was not immediately available for comment.

Libya is the main gateway for migrants trying to cross to Europe by sea, though numbers have dropped sharply since July as Libyan factions and authorities have begun to block departures under pressure from Italy, the main landing point. More than 600,000 have made the journey over the past four years.

Amnesty said the Libyan coast guard — which the EU backs to intercept people heading for Europe — works hand-in-hand with people smugglers, including in torturing people to extort money.

“By supporting Libyan authorities in trapping people in Libya … European governments have shown where their true priorities lie: namely the closure of the central Mediterranean route, with scant regard to the suffering caused,” said Dalhuisen.

With Libya being largely a lawless states since the fall of veteran ruler Moammar Gadhafi, some EU officials and diplomats chafe at what they see as being forced to rely on sometimes shady characters in the matrix of alliances between militias.

However, EU leaders meeting for their final gathering this year in Brussels on Thursday and Friday will recommit themselves to this strategy, which they see as bearing fruit in the form of fewer sea crossings.

The presidency of Libya’s U.N.-backed government said last month it was a victim of illegal migration, not a source of it, and appealed to foreign powers to help stop flows from migrants’ countries of origin.