Two British servicemen have been shot dead in southern Afghanistan by members of the Afghan national police force, the Ministry of Defence has said.
A soldier from 1st Battalion Welsh Guards and a Royal Air Force airman died in Lashkar Gah, Helmand province.
The MoD said the two had been providing security near a base on Saturday. Their next of kin have been informed.
It comes as Afghanistan announced plans to take over security in the Nahr-e-Saraj area where UK forces operate.
The number of UK military deaths in Afghanistan since 2001 is now 414.
The men, who were serving as part of an advisory team, were killed on Saturday as they provided security for a meeting with local officials near Patrol Base Attal.
Defence Secretary Philip Hammond said he believed one of the gunmen was then killed by his Afghan police colleagues, while a second escaped.
'Thousands of contacts'
He told BBC One's Andrew Marr show so-called green-on-blue attacks - in which members of the Afghan security forces attack international allies - were rare, and the motivation for the latest incident remained unclear.
"British forces work alongside Afghan forces every day with thousands of contacts with them every day," he said.
"This is a country that has an insurgency going on in it and, sadly, occasionally, these events occur.
"We don't yet know what the motive was, we don't yet know whether this was an insurgent who'd infiltrated the police or whether it was a policeman who simply had a grievance of some kind.
"This is a society where people traditionally settle grievances by violence."
The sacrifice British troops were making in Afghanistan was for "our own national security", he said.
"Afghanistan was a piece of ungoverned space from which international terrorists were launching attacks on our society and the societies of our allies," he said.
He said the mission was to ensure that the Afghan security forces were able to control the country once international troops ended their combat role in 2014.
The spokesman for Task Force Helmand, Major Ian Lawrence, said: "The thoughts and condolences of everyone serving in the Task Force are with their families and friends."
Earlier, a Nato spokesman suggested the gunmen were insurgents dressed as police officers, but a local police spokesman said they had been members of the national force for a year.
The attacks come a day after a Nato soldier was shot dead in Kunar province. His assailant was wearing an Afghan army uniform.
There have been 22 "green-on-blue" deaths - mostly Americans - so far this year, compared with 35 for the whole of 2011.
A dozen British service personnel have been killed in such attacks since 2009.
Afghan intelligence officials have told the BBC the Taliban want to create a climate of mistrust where Afghan and Nato soldiers cannot work together.
The BBC's Bilal Sarwary said a senior Afghan official in Kabul said the issue of rogue soldiers and Taliban infiltration was an even bigger threat than suicide attacks and Taliban attacks.
He said it was a Taliban "strategy, not a tactic" applied by insurgent groups across Afghanistan, which had officials worried despite their insistence that fresh security measures were in place.
Around 130,000 coalition troops are fighting alongside 350,000 Afghan security personnel against the Taliban-led insurgency.
International combat troops have begun their withdrawal and are due to pull out of Afghanistan by the end of 2014.
Key to that timetable is the training and mentoring of Afghan forces so they can take control of the security of their country themselves.
Shadow defence secretary Jim Murphy told Sky News more needs to be done to protect British troops who remain in Afghanistan.
He said: "If these killers, who carried out this attack, weren't even members of the armed forces then it raises another question which is that in 2015 - when Britain is only doing a training role in Afghanistan and our combat troops have been fully withdrawn - who's going to look after the British trainees."
News of the deaths came as Afghanistan's President Karzai announced that Afghan forces would take lead responsibility for security in another 122 areas of the country, including the Nahr-e-Saraj district of Helmand Province.
Foreign Secretary William Hague said: "Today marks another significant development in the transition process from international to Afghan security lead that will cover about 75% of the Afghan population."