A suicide bomber killed at least 70 people and left 200 wounded in an attack Monday at a hospital in south-western Pakistan.
Both Islamic State and the Pakistani Taliban claimed responsibility for the deadliest attack in Pakistan since a Taliban bombing killed more than 70 picnickers in March.
The bomber blew himself up in the midst of lawyers gathered outside the Civil Hospital in the south-western city of Quetta to mourn a lawyer who was shot dead earlier in the day, provincial government spokesman Anwarul Haq Kakar said.
The Jamaatul Ahrar faction of the Pakistani Taliban claimed responsibility for the attack, hours after the Islamic State extremist group said it was behind the bombing.
Jamaatul Ahrar emailed a statement to media warning of more attacks, which the group's spokesman said would "continue until implementation of sharia [Islamic law] in Pakistan."
Meanwhile, Islamic State said its cell in the Khurassan region, which straddles Pakistan and Afghanistan, was responsible for the attack, a source close to the group told dpa.
Islamic State has been behind previous attacks in Pakistan, but this is the first one it claimed in Balochistan, the largest of the country's provinces and one rich in minerals.
Militant groups in Pakistan often compete in claiming their role in major attacks. At least three outfits said they were behind the attack at the Wagah border crossing with India in 2014 in which more than 55 people died.
Lawyers' associations announced seven days of mourning and a one-day boycott of courts across Pakistan to protest the bombing.
Overall violence has declined significantly since the military pushed back Islamist militants from Pakistan's tribal regions in offensives launched in mid-2014.
The US State Department condemned the attack, saying it struck at "the most important pillars of democracy" by targeting a hospital, the judiciary and the media. The United States offered assistance to the Pakistani government, spokeswoman Elizabeth Trudeau said.
Such "brutal and senseless attacks only deepen our shared resolve to defeat terrorism around the world," she said.