A bomb exploded near the Pakistani military headquarters in the garrison city of Rawalpindi Monday, killing at least four people and wounding 12 others, officials said.