At least eight people have been killed and more than 30 others injured in an explosion that hit a busy shopping area in Pakistan’s second-largest city.

Local authorities initially said the blast was caused by an electrical generator but police said it was a bomb – the latest in almost a fortnight of continuous terror attacks.

Nayab Haider, a spokesperson for Punjab police, the explosion was caused by a “planted bomb” that was either set on a timer or remotely detonated.

Pakistani security officials cordon off the site of a bomb attack in Lahore on February 23, 2017. (AFP/Getty Images)

Security forces cordoned off the area in Defence Y Block, which houses restaurants, banks, offices and shops, preventing people from entering or leaving amid suspicions the bomber was still at the scene.

The force of the explosion blew out the windows of surrounding buildings and cars, spraying them with shrapnel as people fled.

Television footage showed smoke rising from part of a restaurant that was under construction in the Defense Housing Authority complex.

It is controlled by the military-backed department, with housing mainly given to people working for the armed forces.

A witness working in a nearby bank told Reuters he felt the building shake.

“We left the building and saw that the motorbikes parked outside were on fire and all the windows in the surrounding buildings were shattered,” Mohammad Khurram said.

Forensics officers were deployed to the scene as the wounded were taken to nearby hospitals, where volunteers including Punjab's health minister donated blood for the wounded.

In pictures: Pakistan hospital attack Show all 10 1 /10 In pictures: Pakistan hospital attack In pictures: Pakistan hospital attack A man reacts after his relative was killed in a bomb blast in restive Quetta EPA In pictures: Pakistan hospital attack Residents light candles to honour victims of the blast in Quetta during a candellight vigil in Peshawar Reuters In pictures: Pakistan hospital attack People carry the coffin of a victim of suicide bomb attack at a hospital for burial in Quetta REUTERS In pictures: Pakistan hospital attack Pakistani victims injured in a suicide bombing are treated at a hospital in Quetta AFP/Getty Images In pictures: Pakistan hospital attack A lawyer who was injured in a bomb blast wait to receive medical treatment in restive Quetta EPA In pictures: Pakistan hospital attack A doctor treats an injured lawyer at the scene of a bomb blast in restive Quetta EPA In pictures: Pakistan hospital attack People comfort a man mourning the death of a family member who was killed in suicide bombing, at a funeral in Quetta AP In pictures: Pakistan hospital attack People transfer an injured man from the blast site in Quetta Rex Features In pictures: Pakistan hospital attack Pakistani security officials and lawyers gather around the bodies of victims killed in a bomb explosion at a government hospital premises in Quetta AFP/Getty Images In pictures: Pakistan hospital attack The scene following a bomb blast outside a hospital in Quetta Naseer Ahmed/Reuters

A second explosion was reported shortly afterwards in the Gulberg district of Lahore, local media said, but officials said the false alarm was caused by a blown tyre.

More than 130 people have been killed in a wave of terror attacks that started on 13 February, when the Taliban’s Jamaa-ul-Ahrar faction announced the start of a new campaign of violence against the government, security forces, the judiciary and secular political parties.

It has claimed responsibility for the bulk of attacks, including a bombing and shooting that killed a child at a court in Charsadda and another blast in Lahore, but the deadliest single incident was orchestrated by Isis.

The terrorist group, which has an affiliate called Wilayat Khorasan operating in Pakistan and neighbouring Afghanistan, killed around 90 people who had gathered for a religious ceremony at a Sufi shrine.

Isis’ attack, the deadliest in Pakistan for years, was followed by a nationwide crackdown by the military that resulted in the deaths of more than 100 alleged “terrorists” in 24 hours.

The operation sparked warnings from humanitarian groups for Pakistani authorities to adhere to international law.

The violence has also worsened relations between Afghanistan and Pakistan, who have accused each other of harbouring terrorists and each sent lists of named militants allegedly residing in the neighbouring country.