Quetta, Pakistan (CNN) -- A suicide bombing tore through the funeral of a police official in the Pakistani city of Quetta Thursday, killing 30 people -- as well as the bomber -- and wounding at least 40 others, said Quetta Police Inspector Gen. Mushtaq Sukhera.
The blast happened as people lined up for a funeral procession at a mosque, Quetta Police Chief Mir Zubair Mehmood said. Most of the victims were policemen, he said.
Many of the wounded were taken to Quetta's Combined Military Hospital. Doctors there said more than 30 security officials were among the injured, and that 12 people were critically injured.
Three children among 7 killed in Pakistan blast, police say
The police official for whom the funeral was held had been shot dead earlier Thursday, the state-run Associated Press of Pakistan reported.
Prime Minister Nawaz Sharif and outgoing President Asif Ali Zardari condemned the bombing in a statement, the APP reported.
Pakistani artists challenging YouTube ban
Journalist Nasir Habib in Islamabad, Pakistan, and CNN's Aliza Kassim in Atlanta