The shooting on Saturday in Lashkar Gah in southern Helmand province was the latest in a string of attacks by members of Afghanistan's security services on foreign troops and their mentors, heaping pressure on some NATO countries to withdraw.
"Serving as part of an advisory team, the servicemen were providing security for a meeting with local officials ... when they were shot and killed by members of the Afghan police force," the Defence Ministry said in a statement.
British Defence Secretary Philip Hammond told the BBC that one of the gunmen had been killed and the other had escaped.
NATO forces fighting in Afghanistan confirmed that two "individuals" wearing Afghan police uniforms had turned their weapons against coalition forces and killed two.
Some 410 British service personnel have been killed in Afghanistan and many more wounded since the US-led military intervention began in 2001. Britain has about 9,500 troops in the country, and is due to withdraw 500 by the end of the year.
Britain plans to repatriate all its combat troops by the end of 2014.