"We can confirm that UK forces have been involved in an incident in the Sangin valley, during which we regret to confirm that two members of the UK armed forces have been killed in action," a ministry spokesman said.
Sangin is in the southern province of Helmand, the scene of recent clashes between Taliban insurgents, Afghan forces and foreign troops.
Helmand police chief Nabi Mullahkhail said 13 Taliban had been killed in fighting early on Tuesday. No Afghan troops were killed, he added.
A British soldier was killed and two more seriously wounded in a gunbattle with Taliban inurgents in Helmand this month.
A spokesman for the Taliban said its fighters had killed a large number of foreign and Afghan troops in Helmand and destroyed three trucks carrying supplies.
The spokesman, Qari Mohammad Yousuf, said the fighting went on for four hours.
Residents in the area reported heavy fighting including airstrikes by foreign forces.