Sectarian battles continued to rage early Thursday in the north Lebanese port city of Tripoli despite a ceasefire accord reached the previous evening, after four people died, a security official told AFP.

While the ceasefire was meant to come into effect at 8 pm (1700 GMT) on Wednesday, new clashes involving rockets and automatic arms broke out overnight between the poor districts of Bab Al Tebbaneh and Jabal Mohsen in the northeast of the city.

At dawn, the army was attempting to boost its presence in the affected areas, the security official said.

Four people were killed and 58 wounded in street battles between rival sectarian camps armed with rockets, sniper rifles and grenades in Tripoli on Wednesday.

Panicked residents fled the scene of the fighting which first erupted late on Tuesday in two districts of northeastern Tripoli, while several roads were blocked and local shops and schools were closed, an AFP correspondent said.

A security official said four people were killed and another 58 were wounded in the violence, which followed the eruption of similar battles two weeks ago in the port city that left nine people dead and dozens wounded.

The dead included two brothers killed by snipers, a Palestinian nurse and a resident of the Jabal Mohsen quarter.

The latest fighting comes amid continued efforts by Prime Minister Fuad Siniora to form a national unity government, which have been hampered by bickering between rival factions over cabinet posts.

Fighting raged on a main road separating the areas of Bab Al Tebbaneh - where most residents are Sunni supporters of the Western-backed premier - and Jabal Mohsen, which is dominated by members of the Alawite community, an offshoot of Shiite Islam.

Television images showed masked gunmen running across deserted streets and smoke billowing out of nearby buildings as clashes continued intermittently throughout the day.

The security official told AFP that the dead included a Palestinian nurse gunned down by sniper fire, while the wounded included both Sunnis and Alawites.

The two sides announced that they had agreed to observe a ceasefire from 8 pm and allow the deployment of the army in the two neighbourhoods affected by the fighting.

"The army will deploy to maintain security and prevent any armed presence," said a statement released after indirect negotiations between the two sides held under the auspices of the Sunni mufti of north Lebanon, Sheikh Malek al-Shaar.

Sporadic fighting has erupted in Lebanon despite a power-sharing deal between rival factions aimed at ending political crisis that boiled over into clashes that left 65 dead in May and raised fears of a return to all-out civil war.

Main roads in the area have been blocked, including the motorway that connects Tripoli to the Syrian border, while local schools and businesses were shut down.

Siniora, a Sunni Muslim, has been struggling to form a new government despite a May 21 power-sharing deal hammered out in Doha between the ruling majority and the mainly Shiite opposition led by Hezbollah.

He said on Tuesday that he hoped a cabinet could be formed by the time President Michel Sleiman heads to Paris for a Mediterranean summit opening on Sunday.

The Doha accord allocated 16 cabinet seats to the parliamentary majority and 11 to the opposition, while Sleiman is to name three ministers.