The attack in Rawalpindi, next to the capital, Islamabad, came days after the Pakistani Taliban split into two groups, limiting the government's chances of finding a negotiated settlement to end the insurgency.
"A security forces vehicle was targeted, likely by a suicide bomber near Ternol, Rawalpindi," the source said. "Two officers were martyred and three civilians were killed."
The source identified the officers as lieutenant colonels.
No group immediately claimed responsibility for the attack but officials said the Taliban, seeking to set up an Islamic state, were responsible.