Defence ministry spokesman Dawlat Waziri said five soldiers were killed and 10 wounded in the assault claimed by the Islamic State group via its propaganda arm Amaq.
"An Afghan army battalion has come under attack this morning. The attackers wanted to breach the battalion," Waziri told AFP, adding the raid had ended.
"Two bombers detonated themselves and two were killed by our forces and one was detained alive. The fighting is over but unfortunately we have five deaths and 10 wounded."
Officials said the attack was on an army battalion near the Marshal Fahim military academy where high-ranking officers are trained and which was initially identified as the target. An officer at the academy told AFP he could hear an explosion and gunfire.
The gunmen did not enter the heavily fortified compound, which is on the western outskirts of the city, an Afghan security source said.
Witnesses told AFP they heard several explosions and gunfire at around 5:00 am (0030 GMT). Security forces have swarmed the area and blocked roads leading to it, but earlier an AFP reporter at the scene could also hear explosions.
Militants including the Taliban and IS have stepped up their attacks on beleaguered Afghan security forces in recent months, sapping morale already lowered by desertions and corruption.
Afghan troops have taken what the UN describes as "shocking" casualties since international forces pulled out at the end of 2014, though troop casualty figures are no longer released.
The latest raid comes days after a Taliban suicide attacker driving an explosives-packed ambulance blew up in a crowded area of the capital, killing at least 103 people and wounding 235 in one of the worst bombings in the city in recent years.
Today's ambush came as both Taliban and IS militants have escalated their attacks on Kabul, turning it into one of the deadliest places in Afghanistan for civilians.
On January 20, Taliban fighters stormed Kabul's landmark Intercontinental hotel and killed at least 25 people, the majority foreigners, in an ordeal lasting more than 12 hours.
But there is still confusion over the true toll from that attack with conflicting figures given by officials and Afghan media reporting higher numbers.
Several foreign organisations, including humanitarian groups, are reassessing their operations after a particularly deadly week in the country.
IS fighters also attacked Save the Children's office in Afghanistan's east on Wednesday that officials said killed five people and wounded another 26.
Disclaimer: No Business Standard Journalist was involved in creation of this content
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
