Initial reports indicated that the U.S. soldiers were killed but Resolute Support confirmed there were no USA or North Atlantic Treaty Organisation casualties.
"We are aware of an incident", the office said in a statement. "Insider attack Camp Shaheen, Mazar-e Sharif under investigation".
"Seven US service members wounded, evacuated for treatment", US-led North Atlantic Treaty Organisation forces said in a brief statement on Twitter.
For the second time in a week, a man in an Afghan army uniform opened fire on USA service members at a base in Afghanistan.
The Taliban in a statement did not say if they were directly behind the attack, only crediting a "patriotic Afghan soldier" for the assault. "And the attacker was killed in exchange of fire", Qahar Aram, a spokesman of Corps 209 Shaheen, told Xinhua. "We only have reports of injured foreign troops", said Muhammad Radmanish, the ministry's spokesman.
The latest insider attack comes at a time of intensified violence and when the United States is actively considering sending more troops to Afghanistan.
U.S. Defense Secretary Jim Mattis said on Monday he would present options on Afghanistan to President Donald Trump "very soon".
Afghan officials said the perpetrator of the June 10 attack was also an Afghan special forces soldier. "More information will be provided as it becomes available".
The U.S. now has roughly 8,400 troops in Afghanistan (excluding those in country on a temporary basis), while North Atlantic Treaty Organisation and coalition allies have a total of about 5,000 forces.