A suicide bomber struck outside the gates of a district court in Islamabad on Tuesday, detonating his explosives next to a police car and killing 12 people, Pakistan's interior minister said.

The attack was the latest in an uptick of violence across the country.

No group immediately claimed responsibility for the explosion, which also wounded at least 27 people, but Pakistan has struggled over the past months with a resurgent Pakistani Taliban.

The blast, which was heard miles away, came at a time when the area is typically crowded with hundreds of visitors attending court hearings.

Earlier reports by Pakistani state-run media and two security officials said a car bomb had caused the explosion.

The attacker tried to "enter the court premises but, failing to do so, targeted a police vehicle,” Interior Minister Mohsin Naqvi told reporters.

He refrained from blaming any militant group but added that authorities are “looking into all aspects” of the attack.

Naqvi said police investigators also confirmed the blast was caused by a suicide bomber.

According to media reports, the casualties were mostly passersby or those who had arrived for court appointments.

Islamabad police did not immediately issue statements about the attack but said they were still investigating.