The deaths happened after militants attacked Mardyan district around 1:30a.m. from three directions triggering a clash that ended at 6:00a.m., said Abdul Maruf Azar, a spokesman for provincial governor.
Five other militants were seriously wounded in the clash, he said.
The battle left also three Afghan forces dead and two police wounded, he said.
Meanwhile, Taliban attacked security checkpoints in Abe Khustak and Abe Raghak areas of northeast Badakhshan province last night.
Nek Muhammad Nazari, a spokesman for provincial governor, said that Afghan forces tactically retreated from four checkpoints. He said that both sides suffered casualties in the clash.