Libya's National Transitional Council (NTC) is holding about 2,500 detainees in the capital Tripoli alone, many of whom have been beaten and subjected to other ill-treatment and not given access to lawyers or judicial proceedings, Amnesty International, the London-based human-rights watchdog, says.
Prisoners interviewed by the group's researchers said they had been held for various durations, from a few days to a few months and that with rare exception they had not been arrested under any kind of legal order.
In the report released on Thursday, Detention Abuses Staining the New Libya, Amnesty said mistreatment most commonly involves beatings, particularly with wooden sticks or ropes on the feet.
At least two guards in two different detention facilities told Amnesty researchers they beat detainees in order to extract "confessions" more quickly.
Hassiba Hadj Sahraoui, the group's deputy director for the Middle East and North Africa, said: "There is a real risk that without firm and immediate action, some patterns of the past might be repeated. Arbitrary arrest and torture were a hallmark of Colonel [Muammar] Gaddafi's rule.
"We understand that the transitional authorities are facing many challenges, but if they do not make a clear break with the past now, they will effectively be sending out a message that treating detainees like this is to be tolerated in the new Libya."
NTC 'to investigate'
Jalal al-Galal, a spokesman for the NTC, told Reuters news agency that the council leadership would look into the report.
"[NTC Chairman] Mustafa Abdel Jalil has said time and time again that he will not tolerate abuse of prisoners and has made it abundantly clear that he will investigate any such allegations," he said.
Sub-Saharan Africans suspected of being mercenaries made up between a third and a half of those detained, according to Amnesty. Some have been released after no evidence was found to link them to fighting.
A man from Niger, initially presented to Amnesty as a "mercenary and killer", broke down and explained that he had "confessed" after being beaten almost continuously for two days. He denied being involved in fighting.
Amnesty says black Libyans - particularly from the Tawargha region, which was a base for Gaddafi forces in their efforts to regain control of Misrata - are also particularly vulnerable. Dozens of Tawarghans have been taken from their homes, checkpoints, and even hospitals.
The United Nations and the International Committee of the Red Cross (ICRC) have also expressed concern over the sweep of arrests of men accused by interim authorities of fighting for Gaddafi.
Al Jazeera's James Bays visited police stations in Tripoli where detainees were held in August and September when Amnesty carried out its research.
"Many of them were from Sub-Saharan African countries, who came here as workers and were then rounded up and accused of being mercenaries, " he said.
"It's quite possible that some of those people were fighting for Gaddafi but having spoken to some of them myself, it was pretty clear that some of them were also innocent people, rounded up simply because of the colour of their skin".
In meetings with Amnesty in September, NTC officials acknowledged concerns over arbitrary detention and ill-treatment, and pledged to do more to get a grip on armed militias and ensure that all those detained enjoy equal protection of the law.
"The NTC has to act urgently to translate their public commitments into action, before such abuses become entrenched and stain the new Libya's human rights record," Amnesty's Sahraoui said.
"These detainees have in most cases been arrested without a warrant, beaten - and sometimes worse - on arrest and arrival in detention. They are vulnerable to abuse by armed militias who often act on their own initiative.
"The authorities cannot simply allow this to carry on because they are in a 'transitional' phase. These people must be allowed to defend themselves properly or be released."