RAWALPINDI, Pakistan — Two suicide bombers blew themselves up in a mosque and two other militants fired on worshippers near Pakistan’s military headquarters after Friday prayers yesterday, killing at least 40 people, including 10 children.

The mosque is frequented by military officials in the town of Rawalpindi, home to Pakistan’s military establishment.

“There are children among them who had come to pray with their fathers. There are also elderly, retired security officials,” said military spokesman Maj. Gen. Athar Abbas.

He said an army major-general was killed.

Abbas put the death toll at 36. Four terrorists also died, he said. Rescue services and a senior police official said 40. It was not clear if that figure included the four terrorists.