Zabi Amani, spokesman for the provincial governor, says the attack took place in Sangcharak district in northern Sari Pul province early today morning and that the intelligence chief and his deputy were the targets.
Amani says three army intelligence officers and two civilians, including a small child, were also killed in the attack.
He says the Taliban are known to be active the area. No one has claimed responsibility for the attack.
The insurgents have become increasingly active in Afghanistan's northern provinces since the US-led international combat mission pulled out at the end of 2014, leaving a training and assistance mission behind.