Hundreds of demonstrators gathered in the Libyan capital on Sunday to demand the departure of militias and "illegitimate brigades" and the creation of an army and police force, an AFP journalist said.

The protesters thronged Algiers Square in the capital from mid-morning to demand the implementation of a General National Congress order for militias to withdraw from the city.

They chanted slogans against the presence of militiamen and weapons in the city.

"We want a regular army and police force!" and "No to arms!" and "Yes to legitimacy!" cried the demonstrators amid a heavy presence of militiamen who currently enforce the law.

Prime Minister Ali Zeidan, meanwhile, spoke to reporters of the necessity "to dissolve the brigades and other formations (of ex-rebels who battled the late Moamer Kadhafi) and integrate them individually into the army and police".

"In future, no one will bear arms in Libya unless he is in the army or police and is subject to military law... which prevents the taking of political actions," he told a news conference.

Libya's authorities, who are struggling to form a professional army and police, regularly use former rebels to secure the borders or to intervene in tribal conflicts.

The government has failed to disarm and disband the former rebel groups who implement the law in parts of the country.

Last week, deadly clashes erupted between two armed groups in the Abu Slim district near the centre of the capital.