A shocking video that appears to show Libyan rebels torturing a group of sub-Saharan African detainees has appeared on YouTube.

The footage shows a dozen or so men - presumably captured mercenaries suspected of fighting for the toppled government of Muammur Gaddafi last year - held in what looks like a caged zoo enclosure.

They each have their hands tied behind their back and are sat on the cage's dirty floor.

More objectionably, each has the old Libyan flag stuffed into his mouth.Scroll down for video

Shocking: Video footage that appears to show Libyan rebels torturing a group of sub-Saharan African detainees has appeared on YouTube

Prisoners: The footage shows a dozen or so men held in what looks like a caged zoo enclosure, with their hands tied behind their backs and the former Libyan flag in their mouths

While a crowd of men gather round the enclosure jeering, their prisoners are made to hop on the spot.

The man filming the scene, who remains off-camera, can be heard shouting: 'Eat the flag, you dog. Patience you dog, patience. God is great.'

It is impossible to verify whether the video, which was leaked onto YouTube last week, is genuine and where and when it was filmed.

It has emerged as the UN this week said that the Libyan revolutionary brigades accused of torture still hold captive three-quarters of detainees from the country's civil war.

A lack of judicial police has prevented the government from taking control of more jails, the UN said on Wednesday.

Up to 6,000 detainees are estimated to remain in brigade facilities, while the Ministry of Justice has taken charge of eight detention centres holding 2,382 people.

The figures were revealed to the UN Security Council by Ian Martin, the UN special envoy for Libya.

Many of the detainees are sub-Saharan Africans whom their captors accuse of being Gaddafi mercenaries, based in some cases purely on the fact that they have darker skin.

Jeered: The men are likely captured mercenaries suspected of fighting for the toppled government of Muammur Gaddafi last year

Humiliating: While a crowd of men gather round the enclosure shouting, their prisoners are made to hop on the spot

The UN human rights agency and aid groups have accused the brigades of torturing detainees during Libya's nine-month civil war.

Mr Martin has urged the Ministry of Justice to accelerate the process of asserting government control over detention centres.

But he said: 'Progress continues to be complicated by insufficient numbers of judicial police.'

He added: 'We will continue to work closely with the authorities and to encourage them to ensure that inspections of known facilities are undertaken, that secret locations are identified and brought under government control, and that abuses are investigated.'

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

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