The early morning attack in Sari Pul province highlights Afghanistan's fragile security situation, with local forces facing a persistent Taliban insurgency as NATO winds down its military presence.
The police were attacked as they travelled to reinforce colleagues in another district in Sari Pul.
"They were ambushed as they were going from Laghman area to Alaf Safid. Twenty-two police were martyred, eight wounded and seven were taken captive," provincial governor Abdul Jabar Haqbin told AFP.
Around 10 police vehicles were torched, he said.
Also Read
He said the attack sparked a gunbattle that lasted several hours and left 23 Taliban fighters dead.
Kazim Kenhan, a provincial police spokesman, confirmed the incident.
The Taliban were not immediately available to comment, but the ambush is typical of attacks they have launched on Afghan security forces.
NATO combat troops will complete their withdrawal by the end of this year, leaving Afghan troops and police to fight the insurgents on their own.