Militia fighters blamed for the worst unrest in Tripoli since the fall of Muammar Gaddafi pulled out of the capital yesterday with Libyan army units taking up positions around the city.

More than 40 people were killed in street battles between rival militias in Tripoli last week, highlighting Libya’s struggle to curb fighters and hardline Islamists who refuse to disarm two years after ousting Gaddafi.

The latest bloodshed has increased popular anger against militias in Tripoli, where rival groups have often clashed violently over territory or in personal feuds.

The withdrawal of one powerful set of fighters, though, may leave Libya’s fragile government to face more competition among the militia groups that remain in the city.

Western powers, worried about anarchy in a major oil producer and further insecurity in the region, are promising more expertise to build up Libya’s army.

Even as Libya’s new military takes the streets, it is clear it needs more training. Western powers, including the United States and France, have reiterated their support. The US military is working on plans to train 5,000 to 7,000 Libyan security forces.

The country is being closely watched by its North Africa neighbours, worried about violence spilling across porous borders, especially with al-Qaeda militants sheltering in southern deserts where Tripoli has less influence.

The pull-out of the gunmen, who are aligned to the coastal city of Misurata, a centre of anti-Gaddafi resistance, will show how far Libya’s fledgling armed forces are able to control other militias in the capital, and test Prime Minister Ali Zeidan’s will to re-assert control over his vast North African country.

Militias from Misurata, including parts of the so-called Libya Shield Force and the Gharghour Brigades, withdrew from Tripoli yesterday, said Saleh Jouda, a member of the national security committee in the country’s assembly.

Tripoli was calm with many stores, schools and universities closed in support of a strike called by the city’s leaders to demand the militia gunmen leave.

“They have to understand that we want an army, police and rule of law,” said Hisham Alwendy, an activist. “All militias should leave the city, even those who are from Tripoli itself.”

That may be a tough task. Tripoli, like other regions, remains a dangerous patchwork of rival militia territories controlled by Islamist, secular and tribal gunmen. Even the official armed forces, and defence and interior ministries, rely on former fighters for security under a programme to employ the militiamen.

The Prime Minister was himself briefly abducted last month from a five-star Tripoli hotel by gunmen nominally on the govern-ment payroll.

Militia fighters employed to guard oil sites have defected and managed to disrupt Libya’s oil exports in recent months, cutting off the government’s main source of revenue.

Popular protests have helped dislodge Libyan militias before.

A hardline Islamist group was driven from Benghazi last year by armed protests, and residents upset by growing violence confronted part of the Libya Shield Force militia this year.

But in Tripoli, where militias have been carving out territories and influence since the fall of Gaddafi, dislodging them may not be so easy.

“There are some power plays to come about who will replace the militias; clearly it is a fragile situation,” one western diplomat said.

“It is also clear that they cannot go on delaying a decision on how to deal with the militias.”

Misurata’s militias were among the first to move into Tripoli as the war drew to a close in 2011.

Misurata men are in the Libyan Shield Force linked to the de-fence ministry. Across the city are the powerful Zintanis, more secular-leaning and mostly drawn from Bedouin tribes.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.