A year after the start of the uprising against the Gaddafi regime Libya has a new government but the militias that helped oust the "brother leader"' continue to commit human rights abuses, according to Amnesty International.
Opposition fighters that were backed by Nato are still battling for control of the areas they operate in and have refused to give up their weapons.
Amnesty said that of the thousands of suspected Gaddafi loyalists, soldiers and alleged foreign mercenaries captured by the militias during and after the uprising, many have been tortured.
Militias still arrest and illegally detain scores of people, only turning them over to official state agencies after holding them in secret locations, sometimes for months. "Scores of suspected Gaddafi loyalists were unlawfully killed following capture," Amnesty said.
Amnesty delegates interviewed victims of torture held in and around Tripoli, al-Zawiya, Gharyan, Misratah and Sirte.
"They had been suspended in contorted positions, beaten for hours with whips, cables, plastic hoses, metal chains and bars, and wooden sticks and given electric shocks with live wires and Taser-like electroshock weapons," Amnesty said in a report.
At least 12 detainees have died since September as a result of torture, Amnesty added. Many had "their bodies were covered in bruises, wounds and cuts and some had had nails pulled off".
Libyan militias also tried to conceal tortured detainees during visits from Amnesty delegates.
Other widespread abuses include extra judicial executions and rape of men and women.
Reprisals are splitting along ethnic and tribal lines as many detainees are also dark-skinned Libyans and Sub-Saharan Africans.
"African migrants and refugees are also being targeted and revenge attacks are being carried out," Amnesty said. "Entire communities have been forcibly displaced and authorities have done nothing to investigate the abuses and hold those responsible to account."
Tribes associated with the Gaddafi regime have been directly targeted. Militia from Misrata "drove out the entire population of Tawargha, some 30,000 people, and looted and burned down their homes in revenge for crimes some [people of] Tawargha are accused of having committed during the conflict," the report says.
Other internally displaced people include members of the Mashashya tribe and many of internal refugees still live in makeshift camps around the country.
Many fighters in the militias were seeking revenge for the torture of friends and relatives under the Gaddafi regime, Amnesty said.
The National Transition Council, Libya's de facto government, said it was committed to human rights but has struggled to assert control over the militias. It would take some time before the judiciary apparatus gains complete impartiality and independence, it said.
Amnesty's report followed Medecins Sans Frontieres' decision to suspend work in the prison of Misrata because of torture of prisoners. Some of the prisoners were only given access to healthcare so they could face further interrogations and abuse.