ISLAMABAD, Pakistan — The living were honoring the dead on both sides of the border between Pakistan and Afghanistan on Thursday when militant bombers struck, killing at least 44 people in two attacks that coincided with one of the holiest days on the Muslim calendar.

The heaviest toll was inflicted in the Pakistani city of Quetta, in western Baluchistan Province, where at least 30 people died in a suicide attack at the funeral of a policeman who had been killed just hours earlier.

At the eastern end of the border, in the Afghan province of Nangarhar, a bomb exploded at a graveyard where people had gathered to pay their respects to a slain relative. Fourteen women and children from the same family were killed.

Reporters in Quetta described scenes of chaos and devastation after the attack on the police funeral. At least 21 officers were among the 30 killed, including a deputy chief in charge of field operations, Fayyaz Ahmed Sumbal.