The "government and its allied forces are responsible for widespread arbitrary detentions and for torture and other ill treatment", a statement from Human Rights Watch alleged.
The New York-based watchdog said it had obtained access to jails at Bayda and second city Benghazi, currently in the hands of forces loyal to Libya's internationally recognised administration.
Detainees said they had been forced to confess to crimes under torture and "described other abuses, including lack of due process, lack of medical care... and poor conditions", HRW said.
The group found that the most common torture method reported involved detainees being beaten with plastic pipes on the soles of their feet.
Signup to our newsletter and follow us on Facebook and Twitter!
Others were beaten with electrical cables, chains or sticks, it said.
Libya has crumbled since the NATO-backed toppling of autocrat Moamer Kadhafi in 2011, and is divided among warring militias seeking control of the North African state's substantial oil reserves.
It has rival governments and parliaments, and successive UN attempts to end the fighting have so far been unsuccessful.
The internationally recognised government has been exiled in the eastern city of Tobruk since the Islamist militia-led Libya Dawn alliance took the capital Tripoli last year.
Both sides have come under fire from rights groups for failing to avoid civilian casualties in clashes.
"Government ministers, military commanders, and prison directors should immediately declare a non-tolerance policy against torture and hold anyone who abuses detainees to account," said Sarah Leah Whitson, HRW's Middle East and North Africa director.