Armed militants attacked an army outpost near the Marshal Fahim military academy in western Kabul in the early hours of Monday morning, killing 11 soldiers and wounding 15 others, according to the defence ministry.
Afzal Aman, Commander of the Army Garrison, said the military unit was attacked with hand grenades.
Four of the five gunmen were killed and the fifth has been detained.
A local witness reported that the blasts were first heard at about 5 am and continued for at least an hour.
The Islamic State has claimed responsibility for the attack near the military academy.
The latest in a series of attacks in Kabul
This latest incident comes just two days after an ambulance packed with explosives killed more than 100 people in the Afghan capital.
The Taliban has claimed responsibility for that attack, and an earlier assault on a luxury hotel.