Lebanese forces battling followers of a hardline Sunni Muslim cleric have closed in on the mosque where they are taking cover in a southern coastal city, according to the national news agency. It said 12 soldiers had been killed since fighting started on Sunday.

The clashes in Sidon, 25 miles (40km) south of Beirut, are the latest bout of violence in Lebanon linked to the conflict in neighbouring Syria, and the bloodiest yet involving the army.

The news agency said the clashes had also left 50 wounded. The report said it was not clear how many gunmen had been killed or wounded in the clashes, nor whether there were civilian casualties.

The heavy fighting with machine guns and rocket-propelled grenades has caused panic among residents of Sidon, Lebanon's third largest city, which until recently had been largely spared the violence hitting other areas.

The city streets appeared largely deserted on Monday, and local media reported that many residents were asking for evacuation from the area of the fighting, a heavily populated neighbourhood in the city. The news agency said a government building had been hit. The local municipality said the city was "a war zone", appealing for a ceasefire to evacuate civilians and casualties.

Many people living on high floors came down or fled to safer areas, while others were seen running away from fighting areas carrying children. Others remained locked up in their homes or shops, fearing getting caught in the crossfire. Grey smoke billowed over parts of the city.

The fighting broke out on Sunday in the predominantly Sunni city. The army says supporters of Sheikh Ahmad al-Assir opened fire without provocation on an army checkpoint.

It tied the attack to the war in Syria. Assir is a fierce critic of the powerful Shia militant group Hezbollah, which along with its allies dominates Lebanon's government. He supports rebels fighting to oust Syria's president, Bashar al-Assad.

Early on Monday, Assir used Twitter to appeal to his supporters in other parts of Lebanon to come to his aid, threatening to widen the scale of clashes.

The tweets did not give a clear statement on how the battle began. It came after a series of incidents pitting the cleric's followers against other groups in the town, including Hezbollah supporters and the army.

Fighting also broke out in Ein el-Hilweh, a Palestinian refugee camp near Sidon, where Assir has supporters. Islamist factions inside the camp lobbed mortars at military checkpoints around the camp.

Sectarian clashes in Lebanon tied to the Syrian conflict have intensified in recent weeks, especially since Hezbollah sent fighters to support Assad's forces. Most of the rebels fighting to topple Assad are from Syria's Sunni majority, while the president belongs to the Alawite sect, an offshoot of Shia Islam.

Clashes in Lebanon have also mostly pitted Sunni against Shia. The most frequent outbreaks have involved rival neighbourhoods in the northern port city of Tripoli, close to the Syrian border.

The clashes in Sidon centred on the Bilal bin Rabbah mosque, where Assir preaches. The cleric is believed to have hundreds of armed supporters in Sidon involved in the fighting. Dozens of Assir's gunmen also partially shut down the main highway linking south Lebanon with Beirut. On Monday, they opened fire in other parts of the city, with local media reporting gunshots in the city's market.

By Sunday evening, the army had laid siege to the mosque, sealing off access to it from all directions.

In a statement on Sunday, the military openly linked the clashes in Sidon to the conflict in Syria. It said the attacks on its forces by Assir supporters were unprovoked, and accused the cleric of seeking to "incite strife" in Lebanon. The military vowed to hit back with an "iron fist".

Lebanon's president, Michel Suleiman, called for an emergency security meeting later on Monday.