Fighting lasted for several hours on Friday near the city of Mazar-e-Sharif in northern Balkh province.
Insurgents targeted those leaving Friday prayers at the base's mosque and others in a canteen, the army said.
The Taliban said in a statement they had carried out the attack, using suicide bombers to breach defences.
A local source told the BBC the death toll could rise further.
At least 10 Taliban militants were killed in the fighting and one attacker was detained.