Me Key said the SAS had done its job helping Kabul's Crisis Response Unit (CRU) "to the very highest of standards," says Mr Key.
"Tragically, they have also paid the highest price, with two of the SAS's fine soldiers losing their lives in the course of this work and I would, once again, like to pay tribute to Corporal Doug Grant and Lance Corporal Leon Smith who were killed in action.
"I deeply regret the loss of our soldiers but I do not regret our commitment to operations in Afghanistan."
He said the CRU was now considered one of the best trained and most professional units in Afghanistan.
The SAS role alongside the CRU was described as "mentoring" but the troops often got involved in combatting insurgents' actions themselves.
Mr Key said the Provincial Reconstruction Team would continue its work in Bamyan province.