The motive behind the attack wasn't immediately clear.
Khan said police transported the bodies of the slain officers to a hospital and officers were still investigating.
Pakistan has witnessed a surge in violence, mostly blamed on the Pakistani Taliban, who are known as Tehreek-e-Taliban Pakistan, or TTP. It's a separate group but allied with the Afghan Taliban, which seized power in Afghanistan in August 2021.
Many TTP leaders and fighters have found sanctuary in Afghanistan since then and TTP often claims such attacks on security forces and other officials.