The suspected ANA member used small arms fire first on his colleagues, before turning his weapon on the International Security Assistance Force soldiers in Patrol Base Hazrat in the Nahr-e Saraj district of Helmand Province.
Return fire then killed the gunman at the scene, a spokesman for the MoD added.
Major Laurence Roche, spokesman for Task Force Helmand, said: "It is my painful duty to report the death of a soldier from 28 Engineer Regiment, who was shot and killed by a suspected member of the Afghan National Army at a patrol base in the Nahr-e Saraj district of Helmand Province.
"This is an extremely sad day for the Corps of Royal Engineers and everyone serving with Task Force Helmand. Our thoughts are with the soldier's family and friends at this time."
The family of the soldier, who was attached to 21 Engineer Regiment, have been informed and have requested a 24-hour period of grace before further details are released.