Coalition forces returned fire and killed the attacker.
The NATO-led International Security Assistance Force (ISAF) said in a statement that an investigation was under way.
ISAF did not provide more details.
It also did not disclose the nationality of the service member killed.
NATO usually waits for member nations to provide those details.
The incident was the latest in a spate of attacks against U.S. and other foreign troops by their Afghan Army partners.