Lebanese soldiers fired machine guns and rifles into the air and lobbed volleys of tear gas Sunday at hundreds of angry protests who tried to storm the Lebanese government headquarters in Beirut.

The chaotic scene in Lebanon's capital came in the midst of a funeral for a top intelligence official who was killed in a massive car bombing that many blame on the regime in neighbouring Syria.

Several hundred protesters made it to within 50 metres of the entrance of Lebanon's government palace, with thousands more behind them.

The gunfire appeared to push the crowd back. Army commandos marched into the streets wielding clubs. The crowd had marched from Martrys Square, where thousands of people had turned out for Brig.-Gen. Wissam al-Hassan's funeral.

A powerful car bomb in Beirut on Friday wounded dozens of people and killed eight others, including al-Hassan, a Sunni Muslim who was close to the political clan of assassinated former prime minister Rafik Hariri.

His death has inflamed Sunni anger in Lebanon.

The protesters believe the government is too close to Syria and Damascus' ally in Lebanon, the Shia group Hezbollah.

Many Lebanese have raised the possibility that the latest bombing in Beirut is connected to the civil war in neighbouring Syria, which has sent destabilizing ripples through Lebanon for the past 19 months.

Al-Hassan led an investigation over the summer that implicated a pro-Syrian Lebanese politician and one of the highest aides to Syrian President Bashar al-Assad in plots to carry out bombings in Lebanon.

Former information minister Michel Samaha was arrested in August in an overnight raid on his home in Khenchara, Lebanon.

The civil war in Syria has laid bare Lebanon's sectarian tensions.

Many of Lebanon's Sunni Muslims have backed Syria's mainly Sunni rebels, while Shia Muslims have tended to back Assad.

Security was extra tight for al-Hassan's funeral in the Lebanese capital, where thousands of people were gathering in the central Martyrs' Square.

Al-Hassan's body was to be buried next to the tomb of Hariri, who died in a 2005 truck bombing in Beirut.

Lebanese security forces set up road blocks and cordoned off the square ahead of the public funeral. Armoured vehicles and troop transports patrolled nearby streets.

Large posters erected in Lebanon describe al-Hassan, 47, as a "martyr of sovereignty and independence" and "the martyr of Lebanon's dignity."

In central Beirut, dozens of anti-Syrian protesters have erected tents near the cabinet headquarters, saying they will stay until Prime Minister Najib Mikati's government, which is dominated by the Shia militant group Hezbollah and its allies, resigns.

Hezbollah is Syria's most powerful ally in Lebanon, which for much of the past 30 years has lived under Syrian military and political domination.