Libyan residents of Zawiya were out in protest on Thursday against militia groups they accuse of recruiting migrants into their ranks and involving them in alleged acts of torture, residents said.
Zawiya, some 45 kilometres (28 miles) west of the capital Tripoli, is a key departure point for migrants seeking to cross the Mediterranean for Europe, and many seek work there while awaiting the sea crossing.
More than a decade of violence in Libya since the fall and killing of dictator Moamer Kadhafi in 2011 helped turn the country into a fertile ground for human traffickers who have been accused of abuses ranging from extortion to slavery.
Rights groups have repeatedly accused authorities and armed groups operating under state auspices of torture and other abuses.
One recent video circulating on social media purported to show Libyans being beaten by people presented as "African mercenaries", migrants reportedly recruited by rival militias in the city.
Mohamad al-Khabouli, representative of the "Youth of Zawiya" group, said protests began late Wednesday, forcing the city council's closure and blocking access to the oil refinery and roads to the city.
"Hundreds of young people protested, and called for a big demonstration to put pressure on these militias who employ migrants to be expelled from the city", he said.
Angry residents gathered in the city centre, blocking roads and burning tyres, demanding justice and the expulsion of migrants.
The local authorities and the Tripoli government have not officially commented.