Libyan militias have been accused of human rights abuses by Amnesty International, which says militias are holding thousands of people in secret or in unofficial detention centres.
Amnesty also said it found evidence of beatings and torture techniques which led to at least 20 deaths.
Almost three million Libyans are due to elect a General National Congress in Saturday's election as part of the effort to create a new political system in the country.
Some 4,000 candidates are running, the majority of them independents.
But now the militias which overthrew Colonel Gaddafi last year stand accused of replicating some of the excesses of his regime.
Amnesty International visited Libya during May and June.
Its report says the Libyan militias are holding almost 4,000 people in detention centres - some without charge for more than a year.
It found evidence of beatings and torture in 12 of the 15 detention centres visited.
At least 20 people have been tortured to death.
Hundreds of militias remain and refuse to disarm or join the national army or police force.
Amnesty says the new government must build a strong and functional judicial system and ensure those who have committed human rights abuses are brought to justice.