Nigerian girls are being forced to work as prostitutes in Mali "slave camps", say officials in Nigeria.
The girls, many of them under age, have often been promised jobs in Europe but ended up in brothels, said the government's anti-trafficking agency.
The brothels are run by older Nigerian women who prevent them from leaving and take all their earnings.
The agency said it was working with Malian police to free the girls and help them return to Nigeria.
There has been no official comment from the Mali authorities.
Nigeria's National Agency for the Prohibition of Traffic in Persons (Naptip) said officials visited Mali this month to follow up "horrendous reports" from victims, aid workers and clergy in Mali.
They said there were hundreds of brothels, each housing up to 200 girls, run by Nigerian "madams" who force them to work against their will and take their earnings.
"We are talking of thousands and thousands of girls," Simon Egede, Executive Secretary of Naptip, told a news conference in Abuja.
"We are talking of certainly between 20,000 and about 40,000," he said, but did not give details of how the figure had been reached.
In a statement, Mr Egede said girls were "held in bondage for the purposes of forced sexual exploitation and servitude or slavery-like practices".
"The madams control their freedom of movement, where they work, when they work and what they receive," he said.
The trade is centred around the capital Bamako and large cities, but the most notorious brothels are in the mining towns of Kayes and Mopti, where the sex workers live in "near slavery condition", said Naptip.
Many of the brothels there also had abortion clinics where foetuses were removed by traditional healers for use in rituals, said Mr Egede.
Most of the girls were reported to have come from Delta and Edo States in Nigeria.
Many were lured with the promise of work in Europe, given fake travel documents and made to swear an oath that they would not tell anyone where they were going.
On arrival in Mali they were told they would have to work as prostitutes to pay off their debts. Prostitution is legal in Mali but not if it involves minors.
Naptip said it had also uncovered two major trafficking routes used to transport the women from Nigeria through Benin, Niger or Bukina Faso to Mali.
Mr Egede said Naptip was working with the police in Mali to return the girls to Nigeria safely, shut down the trade and prosecute the traffickers.
The BBC's Caroline Duffield in Lagos said the Edo State region of Nigeria in particular had become notorious for prostitution, with thousands of women and girls leaving every year to make money as sex workers.
But the suggestion that there was an organised ring of older women operating as traffickers - and that they were tricking younger women into leaving - was new, said our correspondent.