Firefights between Libyan troops and Islamic militants in Benghazi have killed at least nine people and wounded a further 30, security and medical officials reported.

Gunfire and explosions were heard in the early hours of the morning as smoke rose from Libya's second city. The army ordered residents to remain at home as a safety precaution, according to witnesses.

"A violent clash has been taking place for several hours between our forces and an Ansar al-Sharia cell," Colonel Milud al-Zwei, spokesman for Libya's special forces, said.

Casualties were reported for both the army and Ansar al-Sharia in the Fwaihat area.

Ansar al-Sharia, Libya's top group, is the faction suspected of ambassador Christopher Stevens' death in 2012 in an attack on the US consulate.

Libyan armed forces are beginning to receive aid from the US, Britain, France, NATO and Turkey as western nations assist the military in achieving greater strength than the armed groups in wake of Muammar Gaddafi's fall in 2011.

Ansar al-Sharia, who are believed to have ties with foreign Islamist groups, demands the implementation of sharia law as legislation in Libya and controls sections of Benghazi as well as Syrte and Derna in eastern Libya.

Zeidan met with US Secretary of State John Kerry and British Foreign Secretary William Hague in London to discuss cooperation on 24 November, as western nations become concerned with the deteriorating security situation in North Africa.

After the talks in London, Kerry stated that Libya had experienced great disorder but spoke of "a moment of opportunity".

"The prime minister informed us of a transformation that he believes is beginning to take place and could take place because the people of Libya have spoken out and pushed back against the militias," Kerry said.

Prime Minister Ali Zeidan, who was abducted by militiamen and held for several hours in Tripoli, has called on militants to leave the capital after fatal clashes with protesters ten days ago.

On 15 November militants opened fire on protesters, who were calling for them to leave Tripoli, leaving 46 dead and over 500 wounded.