A former Isis member, who was released from jail two years ago, has killed four members of the Lebanese security forces in a brazen gun attack in Tripoli on Monday night.

The lone attacker, identified by authorities as Abdul-Rahman Mabsout, opened fire on police in the centre of the northern coastal city on the eve of Eid, the feast that marks the end of the Muslim holy month of Ramadan.

Gunfire rang out in the busy streets as the attacker battled with security forces and was chased across the city on a motorbike. The Lebanese army said Mabsout blew himself up with a suicide belt when cornered by soldiers in an apartment.

Two police officers and two soldiers were killed in the shootings.

The country’s interior minister, Raya al-Hassan, described the incident as a “lone wolf attack”. As a precautionary measure, Eid celebrations in the city were cancelled on Tuesday while an investigation was carried out.

Lebanon attack on security forces Show all 10 1 /10 Lebanon attack on security forces Lebanon attack on security forces Military personnel secures the scene where a militant attacked a security forces patrol in Lebanon's northern city of Tripoli Reuters Lebanon attack on security forces Lebanese Army soldiers stand guard outside an area where clashes erupted between Lebanese troops and a a former member of the Islamic State group AP Lebanon attack on security forces A Lebanese Army investigator inspects a scene where clashes erupted between Lebanese troops and a a former member of the Islamic State group, who had engaged in an hours-long shootout with the security forces, in Tripoli, Lebanon, Tuesday, June 4, 2019. Lebanon's interior minister said Tuesday, that a lone gunman who went on a shooting spree in the northern city of Tripoli, killing four security personnel, was working alone. (AP Photo/Hassan Ammar) Hassan Ammar AP Lebanon attack on security forces Lebanese policeman gather at the scene Reuters Lebanon attack on security forces Bullet holes show on a damaged apartment building where clashes erupted AP Lebanon attack on security forces Lebanon's Interior Minister Raya al-Hassan visits the scene Reuters Lebanon attack on security forces A damaged police car Reuters Lebanon attack on security forces A Lebanese Army investigator checks his mobile phone outside a building where clashes erupted AP Lebanon attack on security forces A Lebanese Army investigator inspect inside an apartment where clashes erupted between Lebanese troops and a a former member of the Islamic State group, who had engaged in an hours-long shootout with the security forces, in Tripoli, Lebanon, Tuesday, June 4, 2019. Lebanon's interior minister said Tuesday, that a lone gunman who went on a shooting spree in the northern city of Tripoli, killing four security personnel, was working alone. (AP Photo/Hassan Ammar) Hassan Ammar AP Lebanon attack on security forces A Lebanese Army investigator collects forensic evidence AP

The shooting is the first major security incident to hit Lebanon in more than two years, during which time authorities claim to have thwarted a number of planned Isis attacks.

The country suffered a wave of bombings relating to the civil war in neighbouring Syria between 2013 and 2016, both by Isis and the now defunct al Qaeda-linked Jabhat al-Nusra rebel group.

Tripoli, which lies close to the Syrian border, was particularly hard hit. It is home to communities of supporters and opponents of Syria’s president, Bashar al-Assad, who would frequently engage in gun battles that paralysed the city. It has also struggled to contain the influence of extremist Islamist groups there in the past.

In 2015, an Isis attack by two suicide bombers killed 89 people and wounded more than 200 in the Bourj el-Barajneh suburb of Beirut. The neighbourhood was thought to have been targeted because it is a predominantly Shia area, home to supporters of the Lebanese militant group Hezbollah, which fights inside Syria on the side of the government.

Lebanon’s defence minister Elias Bou Saab said on Tuesday that details of the operation were still unclear, but that Mabsout had fought with Isis in Syria and been jailed for a year in Lebanon upon his return, according to the state-owned National News Agency. He was released in 2017, after serving a little over a year. No group has claimed responsibility for the attack.

Ms Hassan, the interior minister, said the Tripoli attack represented a “new form of terrorism”.

“Can I tell you we can curb it 100 per cent? We can’t curb it. Countries that are perhaps more advanced than us have not been able to,” she told a press conference.

In December, Lebanese authorities announced they had thwarted a plan by Isis to carry out bomb attacks during the country’s parliamentary elections.

The militant group smuggled explosives from Syria in buckets of cheese to use in attacks against places of worship, military targets and gatherings of Christians. But a 10-month police surveillance operation, codenamed “Lethal Cheese”, uncovered the plot.