Television images showed rescue workers ferrying the wounded to nearby hospitals. The explosion left a trail of destruction and pools of blood lay on the floor. It was not clear if the bomber’s two accomplices were either killed or injured in the explosion.

Extremist Sunni militants have repeatedly targeted Shiites in the country, causing a deep sense of insecurity among the Shiites.

Also on Friday, unidentified gunmen fatally shot a provincial lawmaker and his son in the southern port city of Karachi. The lawmaker, Sajid Qureshi, was assassinated after Friday prayers in North Nazimabad, a middle-class neighborhood in the city, which has long been torn by ethnic and political violence.

Mr. Qureshi belonged to Muttahida Qaumi Movement, a political party that has traditionally enjoyed a stronghold over the city. The motive of the killing was not immediately clear.

Prime Minister Nawaz Sharif condemned the violence and vowed to bring the culprits to justice.

The continued spate of violence poses a grave challenge for Mr. Sharif, who was voted into power after the May 11 general elections and only recently took office. He has promised to bring peace in the country and revive its troubled economy. However, the continuing violence has raised questions about his ability to deliver on his election promises.

Ismail Khan contributed reporting from Peshawar.