The Libyan government is to investigate allegations that African migrants are being sold as slaves at auctions.

Tens of thousands of migrants, many of them from West Africa but also Bangladesh, Somalia, Sudan and Eritrea, are being held in camps and warehouses on the Libyan coast, hoping to reach Europe.

When the warehouses become overcrowded, or if migrants are unable to pay traffickers for the boat journey towards Italy – where many are rescued by NGO-operated vessels – they are sold.

The existence of modern-day slave markets has been known for months, with testimony from the International Organisation for Migration and other humanitarian agencies, but last week CNN obtained video footage of one such auction.

In scenes reminiscent of the 19th century, when the slave trade was rife, auctioneers advertised a group of West African migrants as “big strong boys for farm work.” The auctioneers referred to the migrants in Arabic as “merchandise”.

The CNN footage showed buyers bidding for the migrants, who were sold off for as little as $400 each. One West African man told the television network: “Sure, I was sold”. Others recounted how they were beaten by their “owners” as they put to work.

Ahmed Metig, the deputy prime minister of the UN-backed Government of National Accord in Tripoli, said the allegations would be investigated.