Kabul police chief's spokesman Hashmat Stanekzai said on Thursday that shortly after 10am gunmen stormed a building close to a National Directorate of Security (NDS) military training center in Qala-e-Wazir in PD5 in Kabul city.
Just after 4pm, Minister of Interior Wais Barmak confirmed the attack had ended.
He said three insurgents had been involved - all of whom were killed.
Police said earlier three people had been wounded in the 6-hour clash.
Gunmen reportedly entrenched themselves in a building that was under construction and used this as a vantage point.
Security forces however immediately cordoned off the area after the attack was launched and evacuated residents in the immediate area.
At least two explosions were heard, which residents said had been rockets.
This was yet another attack on a military facility this week.
On Wednesday, a police source in Baghlan said that at least 35 Afghan National Army (ANA) officers and ten policemen were killed when the Taliban launched an attack on a military base in Baghlan-e-Markazi district on Tuesday night.
The head of Zabul provincial council also confirmed that the Taliban launched an attack on an army check post in Qalat city on Tuesday night. He said over 400 Taliban fighters took part.
Police forces were also targeted in Kandahar this week, in Arghandab district.
These incidents came close on the heels of the Faryab incident on Monday which saw Afghan troops surrender to the Taliban after their base - Chenayeeha - in Gormach district, fell to the insurgents.
The base had reportedly been under Taliban siege for 48 hours.
According to local officials, over 40 security force members surrendered after they received no help nor ammunition supplies despite repeated requests.
In this weekend's crisis in Ghazni, Taliban fighters also targeted a military facility, this time the city's police headquarters - which appears to have been compromised as reports indicate insurgents seized military equipment during their raid.