A suicide bomber has killed two Pakistani soldiers and three civilians near Islamabad, the army says.
The two officers were on their way to work when they were attacked on the outskirts of the garrison city of Rawalpindi close to the capital.
No group said they carried out the attack but officials blame the Taliban.
Meanwhile, two Pakistani soldiers have been killed by militants along the border with Afghanistan, the military says. Three others were injured, including an officer, when military posts came under attack in the Bajaur tribal region, the army said.
It is thought Pakistan Taliban leader Mullah Fazlullah could be based in the Afghan province of Kunar, which borders Bajaur.
The violence comes after the Pakistani Taliban ended a short ceasefire in mid-April which had been agreed as part of peace efforts with the government. Pakistan and Afghanistan accuse each other of letting militants use their territory for attacks on one another. On Sunday Pakistani forces killed 16 suspected militants following a series of attacks on military checkpoints near the Afghan border. Afghanistan said four of its civilians had been killed.