Hundreds of Libyan protesters forced members of a hardline Islamist militia out of their base in the second city of Benghazi Friday, setting fire to and wrecking the military compound.

Members of the Salafist jihadi group Ansar al-Sharia fired in the air before being forced out of their base by the demonstrators.

The assault came as an estimated 30 000 people rallied against the influence of militias in the city, which critics say have put themselves above the law.

Their protest drowned out a smaller rally by hundreds of radical Salafists angry over a film and cartoons deemed offensive to Islam.

Ansar al-Sharia has been accused of involvement in the 11 September attack on the US consulate in Benghazi in which the US ambassador Chris Stevens and three other US citizens were killed. It denies the charge.

On Friday, US Secretary of State Hillary Clinton for the first time described that assault as a "terrorist attack".

The militia, which rejects democracy and refuses to join the national security forces, raged against a film made in America mocking Islam and French cartoons depicting the Prophet Mohammed.

Earlier Friday, a group of Benghazi residents stormed the barracks of another group, the Martyrs of Abu Slim brigade, and ousted its members.

"We kicked them out and called the army to take over this place," Hamza Jehani told AFP, adding that around 70 people had forced their way inside and driven the militiamen out.

Benghazi, where the armed insurrection against the regime of Moamer Khadafi started in 2011, has recently seen several attacks on western interests.