The Libyan government is to investigate reports by rights groups that former rebels who fought to oust Muammar Gaddafi are now torturing detainees in makeshift prisons around the country, Deputy Prime Minister Mustafa Abu Shagour said Tuesday.

Abu Shagour's comments were a response to a damning statement last Thursday by the aid agency Medecins Sans Frontieres, saying it had stopped its work in detention centres in the city of Misrata because its medical staff were being asked to patch up detainees mid-way through torture sessions so they could go back for more abuse.

The agency said it was in Misrata, 200 km (130 miles) east of the Libyan capital and scene of some of the fiercest battles in the conflict, to treat war-wounded detainees but was instead having to treat fresh wounds from torture.

Any violations of human rights will be subject to investigations, Abu Shagour told a two-day workshop organised by the United Nations and the European Union to address Libya's immediate priorities in the transitional period.

We are asking all revolutionaries to respect human rights, he said in a plea to the myriad locally based militias, many of whom continue to run their own prisons where they hold loyalists of the former regime detained during the revolution, and suspected criminals captured after liberation.

Reports of the mistreatment and disappearances of suspected Gaddafi loyalists are embarrassing for Libya's ruling National Transitional Council (NTC), which has vowed to make a break with practices under Gaddafi and respect human rights.

The allegations are also awkward for the Western powers which backed the anti-Gaddafi rebellion and helped install Libya's new leaders.

The ability of the government in Tripoli to rein in torture is limited as it is still struggling to bring to heel dozens of armed militias who have carved the country into rival fiefdoms and are so far refusing to disarm and join a newly created national army.

Many former rebels say they are suspicious of the country's new rulers and want to remain armed in case Gaddafi loyalists outside the country try to sow strife in Libya.

Foreign states are worried about the NTC's capacity to secure its borders against arms traffickers, al Qaeda insurgents and migrants trying to reach Europe illegally.

(Editing by Giles Elgood)