Lebanese soldiers arrested a would-be suicide bomber inside a crowded cafe in one of the busiest neighbourhoods in the capital Beirut on Saturday night, security sources told AFP.

The sources, speaking on condition of anonymity, said a man wearing an explosive bomb belt had been detained by authorities after entering a coffee shop in the upscale Hamra neighbourhood in west Beirut.

The man told interrogators that he had pledged allegiance to Islamic State and had been acting on orders from Raqqa, the group's stronghold in Syria, sources told Al Jazeera.

The cafe that was targeted is on the main street of the bustling area and was filled with people socialising on a weekend evening when the arrest occurred around 2100 GMT.

The sources said the man had been followed by security forces, which have stepped up foot patrols in the neighbourhood in recent weeks.

The man was injured during the arrest, with several soldiers holding him down to ensure he was not able to detonate the belt, one security source said.

He was taken to a nearby hospital for treatment before interrogation, the sources added.

Lebanon has been hit by a string of bomb attacks in recent years, with some linked to the ongoing war in neighbouring Syria.

Some of the deadliest blasts have targeted neighbourhoods sympathetic to the powerful Shia Hezbollah movement, which is fighting alongside Syria's government against an uprising.

The casualties in the blasts have been almost exclusively civilians.

The Hamra neighbourhood, a district known for shopping and nightlife, has not previously been hit by an attack.

In June 2016, the army said it had arrested militants from the Islamic State group planning attacks against busy areas, including Hamra.

An AFP correspondent in Hamra said a heavy security presence remained in place with the cafe and several nearby restaurants closing after the incident.

Residents could still be seen on the street, which was reopened to traffic about an hour after the arrest.