TRIPOLI/TUNIS (Reuters) - Residents of Tripoli emerging from their homes to take advantage of a ceasefire between armed groups noticed one thing straight away. The militias had not withdrawn their heavy weapons from strategic locations in the Libyan capital.

FILE PHOTO: Smoke raise as people check the damaged after a rocket hit a camp for displaced people during the fight between rival armed groups in Tripoli, Libya September 2, 2018. REUTERS/Stringer

A truce brokered by the United Nations on Tuesday after a week of violence between local fighters has largely been observed.

The clashes, which left dozens dead, pitted four big armed groups in Tripoli against rivals from other towns. The fighters had joined forces in 2011 to topple Muammar Gaddafi but since then they have refused to disarm, using their guns to compete for access to public funds.

But even as the ceasefire began, residents and diplomats braced themselves for more violence.

The factions withdrew their pickup trucks mounted with anti-aircraft guns and dismantled checkpoints. But they kept their heavy weapons at key positions such as Matiga airport, government ministries and some of the city’s main streets.

“It’s good that there is no fighting now but the two sides are still in their positions,” said a frightened resident who gave his name only as Mohamed. “I am afraid clashes will erupt any time.”

The armed groups have vowed to resume hostilities if talks to be hosted by U.N. Special Envoy Ghassan Salame do not result in a lasting settlement.

“We are committed to the ceasefire as long it has not been breached by the other side,” said Ahmad Ben Salim, spokesman for the Special Deterrence Force, one of the biggest Tripoli units.

“Our force is still in its position ... and we are waiting for what will emerge with the ceasefire.”

The force’s main opponent, known as the 7th Brigade, also confirmed to Reuters it would stay in its positions.

SPEECH

In a blunt speech at the U.N. Security Council on Wednesday, Salame said groups that violate the ceasefire must be held to account and the time for impunity was over.

Salame has been trying for a year to pave the way for national elections. But he gave no details of what he planned to do if the truce was broken.

“It was encouraging that he overtly states that impunity must end,” said Tarek Megerisi, a visiting fellow at the European Council on Foreign Relations.

“However, as always the implementation details are absent,” Megerisi said. “How will the monitoring and punitive measures he mentions work in practice?”

A Western diplomat added: “Salame needs to do something bold now but it’s not clear what he could do. If nothing happens it will be a break for the militias to recharge their batteries.”

With no national army or foreign peacekeepers in place, the only short-term fix would be to allow some of the groups from outside Tripoli to pay their fighters from public funds.

Turning young men with guns into civil servants has been the main policy goal since 2011, but it has not succeeded.

As the armed groups became greedier, and emptying state coffers to pay them off left little money to fix dilapidated hospitals and other infrastructure, frustrated youths were driven to join the militias.

Militias have meanwhile been looking for new sources of funds. Diplomats said fighters providing security for ministries are forcing officials to provide letters of credit intended for imports. These are used to obtain foreign currency which can be changed on the black market at a favorable rate.

POWERS

After the fall of Gaddafi, Western powers tried to train a Libyan army. But that plan ended in 2014 when the country split into rival administrations in west and east.

The powers have since switched tactics, allowing the U.N.-backed administration in Tripoli to legitimate “super militias”, giving them state funds and titles for the sake of stability.

Salame is now expected to negotiate a broader power sharing agreement under which more fighters will be brought in with the aim of securing Tripoli.

However, diplomats fear that General Khalifa Haftar, who has conquered much of the east with his Libyan National Army faction and is said to be planning to run for president, may intervene in Tripoli.

“The liberation of Tripoli in accordance with a military plan is an inevitable choice,” Haftar said on Thursday. “The crisis in Tripoli must end as soon as possible and we cannot be silent in the current situation.”

Haftar has long contemplated extending his influence in the west of Libya by linking up with local groups there.

Since the outbreak of fighting in Tripoli, pro-Haftar TV channels have supported the 7th Brigade, which comes from Tarhouna, south of Tripoli.

But the Tarhouna forces cooperate with an Islamist commander, Salah Badi, an opponent of the general. Haftar meanwhile has built a reputation for fighting people he calls “Islamist terrorists”.

Such fragile alliances show how difficult it will be for Salame, the sixth U.N. Libya envoy since 2011, to build on the ceasefire.

Those who have met him recently say he has been frustrated by lack of progress since unveiling a peace plan a year ago that would entail a new constitution and a national government.

If Salame succeeds it will be a “coup” for him, a diplomat said, but if not, his standing in Libya will be damaged.