One Afghan soldier was killed and another was hurt in the attack that occurred around 2 p.m.at Camp Shaheen in Mazar-i-Sharif in Balkh Province, according to a statement from the press office of Operation Resolution Support, the us and North Atlantic Treaty Organisation mission to train and advise Afghn forces.
A member of the 43rd Georgian Light Infantry Battalion moves into position during a June 10, 2015, joint force protection mission with USA forces outside Bagram Air Field in central Afghanistan.
The attacker was shot and killed and one Afghan soldier was wounded.
Saturday's attack marks at least the second violent incident this month involving American personnel embedded with Afghan security forces.
Earlier in the day, the mission issued a statement, saying that the attack, which took place at 2 p.m. local time (approximately 9:30 GMT) killed one Afghan serviceman and wounded another.
Insider attacks had frequently happened in the past, when Afghan soldiers or policemen fired on foreign forces, causing casualties.
The NATO-led mission said it has opened an investigation.
Four foreign soldiers were also injured when the Afghan soldier opened fire on foreign troops in Mazar-i Sharif, an Afghan military spokesman told CNN.
The gunman - an Afghan - had been shot and killed, the spokesman said. At least 200 soldiers and officers were killed and dozens others were wounded.
After more than 15 years of war the Taliban control broad swathes of the country and the struggling Afghan security forces continue to take an nearly unsustainable amount of causalities as they battle to hold provincial capitals. The coalition source also said no members of the United States military were killed. The brazen assault, which came as Mattis arrived in Afghanistan, led to the dismissal of Afghanistan's top defense officials by President Ashraf Ghani.