ISLAMABAD, Pakistan — A suicide bomber struck a hospital in the southwestern Pakistani city of Quetta on Monday, officials said, killing at least 74 people in another devastating attack on civilians in a city that has become a byword for massacre and struggle over the past decade.

Before the bomber attacked, dozens of lawyers had gathered at the hospital to condemn the shooting death hours earlier of a prominent colleague, officials said. They feared that the death toll from the bombing would rise, given the vast crowd of people seriously wounded in the attack.

Late on Monday evening, Jamaat-ul-Ahrar, a splinter group of the Pakistani Taliban, claimed responsibility for the shooting and the bombing. “Our attacks will continue till the imposition of the Islamic system in the country,” the statement of responsibility read.

The bombing was also claimed by the regional branch of the Islamic State, according to the Amaq news agency, which is affiliated with the militant group. If confirmed, that would be a first attack by the group in Pakistan — though the claim may be related to the fact that in the past, the Jamaat-ul Ahrar splinter group has expressed support for the Islamic State.