A suicide bomber targeting Shia Muslims killed 12 people Friday in an attack on two buses in northwestern Pakistan.

Tensions between Pakistan's majority Sunnis and Shias had made the road unsafe for minorities travelling to the nearby Kurram tribal region. Police recently had declared it safe, but Shias are provided security when they travel through it.

Friday's attack only targeted the buses carrying Shias, police official Akram Ullah said. Security forces escorting them weren't harmed in the attack.

The victims were passing through a gas station in the town of Hangu when the lone attacker on foot set off the bomb, Ullah said.

Five people were killed at the scene and seven others died at hospitals, he said

The area is near al-Qaeda and Taliban-controlled parts of Pakistan's tribal belt.

An army offensive that began in October against the Pakistani Taliban spurred a bloody wave of attacks across the country that killed more than 600 people.

In January, 75 people died after a suicide car bomb was detonated at a volleyball game in Pakistan's northwest.