The Taliban claimed responsibility for yesterday's attack at Patrol Base Hazrat, in the Nahr-e Saraj district of Helmand.
Nato command spokesman Brigadier General Gunter Katz said a suspected member of the Afghan National Army opened fire on international (Isaf) and Afghan troops.
He said: "The shooter, who actually turned his weapon against members of the Afghan National Army and Isaf was shot during the incident."
The soldier was a member of 28 Engineer Regiment attached to 21 Engineer Regiment. The Ministry of Defence said next of kin had been informed.
The incident underlined the threat from so-called green-on-blue attacks by renegade members of the Afghan security forces, which have claimed all six British soldiers killed on the current tour of duty.
Nato figures show 61 people were killed in 45 incidents last year, compared with 35 in 21 attacks in the preceding 12 months.
Downing Street described the latest killing as tragic and said measures had been taken to step up protection for troops in Afghanistan, including stronger vetting and screening of recruits to Afghan security forces.
A Taliban statement named the "infiltrator" who carried out the attack as Mohammad Qasim Faroq.