A suicide bombing outside district court buildings in the Pakistani capital Islamabad killed at least 12 people and wounded 27 on Tuesday, the interior minister said.

The first such attack to hit the city in years sent people fleeing in panic, leaving shattered glass and charred vehicles on the road.

"A suicide attack was carried out," Interior Minister Mohsin Naqvi told journalists. "So far 12 people have been martyred and around 27 are wounded."

An AFP journalist saw paramilitary troops cordoning off the area where the minister said the assailant detonated explosives near a police vehicle.

"We are trying to identify who he (the attacker) is and where he came from," Naqvi said after the blast, which struck an area that also houses several government offices.

There was no immediate claim of responsibility, with Prime Minister Shehbaz Sharif pinning the blame on "terrorist proxies backed by India", Pakistan's longtime foe, without providing evidence.

India's capital Delhi was hit by a car explosion Monday, which killed at least eight people.

Sharif accused the Pakistani Taliban (TTP) militant group and separatists from the country's Balochistan region, both of whom have carried out attacks mostly targeting the security forces.

In Islamabad, lawyer Mohammed Shahzad Butt said there was a "massive blast".

"Everyone started running inside out of panic. I have seen at least five dead bodies lying at the front gate," he told AFP.

Rustam Malik, another lawyer, told AFP he "heard a loud bang at the gate" as he was entering the complex.

"It was complete chaos, lawyers and people were running inside the complex. I saw two dead bodies lying on the gate and several cars were on fire," said Malik.

- Cross-border violence -

Islamabad has largely been spared major militant violence in recent years, with the last suicide attack occurring in December 2022.

But the country is facing a resurgence of attacks, which officials attribute mainly to armed groups allegedly sheltered on Afghan soil.

The bombing came as Pakistani security forces battled militants who had holed up in a school in northwest Khyber Pakhtunkhwa's Wana district, near the Afghan border.

"There was an attack in Wana as well last night," Naqvi said. "Three people died in that attack. The attacker involved in that attack is an Afghan. Afghanistan is directly involved in that attack."

Recent attacks prompted a bloody clash between Pakistan and Afghanistan in October, their worst fighting across their border in years.

More than 70 people were killed on both sides, including about 50 Afghan civilians, according to the United Nations.

The two countries agreed to a fragile ceasefire, but failed to finalise its details during several rounds of negotiations that collapsed last week. Each side blamed the other for the impasse.

Pakistan's Defence Minister Khawaja Asif said the Islamabad suicide attack should be seen as "a wake-up call".

"In this environment, it would be futile to hold out greater hope for successful negotiations with the rulers of Kabul," he wrote on X.

Islamabad accuses Kabul of sheltering the Pakistani Taliban and other militant groups that launch attacks across a long, porous border, which the Afghan government denies.