One Afghan soldier was killed and another was hurt in the attack that occurred around 2 pm. Special forces killed four of the insurgents but two held out for several hours, it said, adding that nine police and 13 civilians were wounded in addition to the dead.
Analysts say such attacks are expected to increase this year as U.S. troops engage with the Afghan military to double the size of its special forces, considered to be effective in the fight against insurgents.
His description of the assault suggested a well-prepared and coordinated assault.
The head of the police hospital, Dr Shir Mohammad, confirmed the five fatalities.
Islamic State claimed responsibility for a deadly attack on a mosque in Kabul on Thursday.
The diverse locations of the two most recent insider attacks shows the depth of reach now available to insurgents, with one attack taking place in eastern Nangarhar province and the second in northern Afghanistan's Balkh province.
"The Taliban have been able to bring in soldiers into the Afghan army and make them sleepers, as it were, until the right time", journalist Ahmed Rashid told Weekend All Things Considered in April. In that case Mujahid claimed that the shooter was a Taliban loyalist who infiltrated the army specifically to seek out opportunities to attack foreign soldiers.
Last Saturday, an Afghan commando fatally shot three USA soldiers and wounded a fourth during a joint U.S.
With the spiral of violence escalating in Afghanistan, the United States now seems thinking of increasing troop levels in the country.
According to a U.S. Military spokesperson, the shooting happened at Camp Shaheen in Northern Afghanistan. They mainly serve in a training and advisory capacity. But it also blames many attacks against foreign troops on what it calls cultural friction, where Afghans become infuriated by a perceived insult.
"The matter has been raised with the relevant Afghan authorities, who have informed that all efforts were in hand to probe the incident".
The insurgents are also targeting the worldwide coalition supporting Afghan forces. "It would enable Afghan farmers quick and direct access to the Indian markets for their perishable produce", said Deepak Mittal, Joint Secretary, (PAI-Pakistan, Afghanistan, India) in the Ministry of External Affairs in Delhi.