Gunmen opened fire on a Shia Muslim religious procession in Pakistan on Friday, killing eight and injuring more than 30.

Officials at a hospital in the city Rawalpindi, near Pakistan's capital Islamabad, said rocks were thrown at the procession as it passed a Sunni Muslim seminary and the altercation quickly escalated into open gunfire.

Police officer Afzal Hussain told the AFP news agency the incident began when Shia Muslims dragged Sunnis out of the seminary after hearing them insult the procession as it passed by.

Several Shias were then killed and dozens of shops outside the seminary were set on fire in the latest incidence of spiralling sectarian violence in the region.

Police officers trying to contain the clashes were injured by stones thrown by both sides as the situation worsened.

An army unit brought the situation under control and a curfew has now been imposed in Rawalpindi.

Shia girls protest against targeted killings, which claimed the lives of hundreds of Shia Muslims across Pakistan in 2012. (Reuters)
Shia girls protest against targeted killings, which claimed the lives of hundreds of Shia Muslims across Pakistan in 2012. (Reuters)

The Shia Muslims were observing Ashura, which in the Shia branch of Islam is an annual day of mourning that marks the death of Imam Hussein, a grandson of the prophet Mohammad.

The observance involves long processions of mourners who beat, flagellate or cut themselves to show their grief.

Pakistan's Shia Muslims have called for the government to take action against the perpetrators of the killings and form a judicial commission to investigate the bloodshed.

Shias have accused the government of failing to provide adequate security for the community, which makes up a minority of Pakistan's Muslim population, which is predominantly Sunni.

Attacks on Shias have escalated in recent years, with much of the violence blamed on Sunni Muslim fighters affiliated with terrorist groups such as the Taliban and Lashkar-e-Jhangvi.

According to Human Rights Watch, hundreds of Shia Muslims were killed in targeted attacks in 2012, with more than 100 killed in Balochistan province alone.