The Libyan government has been unable to control groups of armed men, many of them former rebels who fought to oust Col. Muammar el-Qaddafi last year and who now commit crimes with impunity, operate detention facilities outside the reach of the law and regularly engage in torture and revenge attacks, according to a report by Amnesty International released on Thursday.

As my colleague Anthony Shadid reported from Tripoli last week, the powerlessness of the government is such that the national army is treated like just another armed group. As a result, Libya’s leaders have been unable to rein in the large number of lawless militias with regional or tribal allegiances who fight one another with disturbing frequency. Human Rights Watch has estimated that there are 250 separate militias in the coastal city of Misurata alone.

In its 45-page report, Amnesty International accused militiamen of broad human rights abuses against those who are suspected of being loyalists of the deposed leader. In addition to revenge attacks and the forced displacement of certain groups, the report described the torture of those in unofficial detention:

In January and early February 2012, Amnesty International delegates interviewed scores of victims of torture who were held in and around Tripoli, al-Zawiya, Gharyan, Misratah, and Sirte, as well as several families of people who died in the custody of militias after they were tortured. Detainees told Amnesty International that 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 electro-shock weapons.

At least 12 detainees have died since September while in detention by militias or in a hospital shortly after being released, the group said.

Sub-Saharan Africans appeared to have been targeted for arrest and abuse, according to the report. “When Amnesty International delegates visited Ain Zara Prison in January 2012, about 400 out of approximately 900 detainees were foreign nationals, mainly from sub-Saharan Africa,” the group said of a prison in Tripoli that was under the control of local fighters.

The rights group urged the Libyan government to do more to stop the vigilante violence by militiamen and to establish a trained security force, close unofficial detention centers and investigate torture and other crimes against detainees.

Their calls echoed similar pleas by other rights advocates in recent weeks, including Human Rights Watch, which this month called on Libya’s leaders to “show the political will to prosecute people who commit serious crimes, regardless of their role in the uprising.”