Amnesty International will warn tomorrow that abuses against foreign residents in Libya now are worse than under former leader Muammar Gadaffi.
The rights group compiled the report We Are Foreigners, We Have No Rights over several visits to the north African country between May and September.
Amnesty said foreign nationals are at risk of "exploitation, arbitrary and indefinite detention and beatings, sometimes amounting to torture."
Armed militias acting outside the law were guilty of numerous abuses, it said.
In one case a Somali man was "kicked and dragged along the ground, punched in the eye and beaten with rifles and sticks" after he tried to escape from a detention facility in Khoms.
In another incident a woman from Nigeria detained in Tripoli's Tweisha detention centre reported being beaten and given electric shocks.
"The world needs to know what is happening to us," she told Amnesty. "For Libyans we are not even human."
Libya makes no formal distinction between migrants, refugees and asylum-seekers and the government has refused to sign a memorandum of understanding with the UN refugee agency or ratify the UN refugee convention.
This means the thousands arrested for "migration offences" cannot legally challenge their detention.
In some cases those jailed are told to pay the cost of their own deportation and remain in legal limbo if they cannot do so.
Amnesty Middle East and north Africa deputy director Hassiba Hadj Sahraoui said: "It is shameful that Gadaffi-era abuses have not only continued but worsened."