About 4,000 accused supporters of former dictator Muammer Gaddafi are still being held in Libyan militia detention centers, often in secret and many are tortured, a UN envoy said Thursday. Ian Martin, head of the UN mission to Libya, said good progress was being made toward the country\'s first democratic election, but militia prisons were one of a number of \"serious obstacles\" to establishing the rule of law. \"Cases of mistreatment and torture of detainees continue,\" Martin told the UN Security Council. The UN has raised \"deep concern\" over the deaths in April of three people at a prison in Misrata which comes under government authority. There was \"credible information\" that the deaths were caused by torture and that at least seven other people had been tortured at the same prison, said the head of the UN Support Mission in Libya, or UNSMIL. There have also been allegations of torture at prisons in Tripoli, Zawiya and Zintan. The UN said in October that 7,000 prisoners, mainly supporters of Muammer Gaddafi, were held by the revolutionary brigades which led the fight to overthrown the late dictator last year. About 4,000 are estimated to remain in formal and secret prisons around the country where the transitional government is only slowly getting a grip on power, Martin said. The justice ministry now has 31 detention facilities with about 3,000 inmates, he said. But control of many of these is shared with the revolutionary militias that have retained significant powers. \"Addressing these practices should be a top government priority in pursuit of a new culture of human rights and the rule of law,\" said Martin. Gaddafi\'s government was notorious for rights abuses. The interim government has passed a law which orders militias to refer all cases against Gaddafi supporters to prosecutors by July 1. But the envoy also raised concerns about some aspects of new laws that grant amnesty to fighters involved in overthrowing Gaddafi and which criminalize \"the glorification\" of the dictator who was killed in October. Human Rights Watch and other groups have said the amnesty law could allow people who have committed \"serious crimes\" to go free based on politics. \"It propagates a culture of selective justice that Libyans fought so hard to overcome,\" said HRW\'s Middle East and North Africa specialist Joe Stork. Martin said that as of Wednesday night, just over one million people had registered for the country\'s first ever democratic election. The ruling National Transitional Council has pledged to hold the election for a 200-seat constituent assembly in June, but diplomats said there are worries that it may have to be delayed. Martin said there was a potential voting list of between three and 3.5 million people. Registration opened on May 1 and the UN envoy said women made up only 36 percent of those who had put their names down so far.