NATO special forces rescued two foreign women and killed five kidnappers in a "breathtaking" pre-dawn raid Saturday on a cave in Afghanistan's remote and mountainous Badakhshan province.
The women, who worked for Swiss-based charity Medair, were named as Briton Helen Johnston, 28, and Kenyan Moragwe Oirere, 26. Two Afghan colleagues kidnapped with them on May 22 were also freed unharmed.
All are well, Afghan officials told AFP.
"The mission to rescue the hostages was launched in the early hours of today under cover of darkness with the assistance of helicopters," a spokesman for NATO'S International Security Assistance Force said.
"The hostages were being held in a cave in the mountains."
British forces took part in the operation, which was authorised by Prime Minister David Cameron, the British foreign office (FCO) said.
The prime minister said he gave the go-ahead on Friday afternoon, after becoming increasingly concerned about the safety of Johnston and her colleagues.
"It was an extraordinarily brave, breathtaking even, operation that our troops had to carry out," he said. "I pay tribute to their skill and dedication."
The victims were seized at gunpoint while travelling on horseback across rugged terrain to relief project sites in Badakhshan in northeastern Afghanistan.
Cameron said the rescue should serve as a warning to terrorists across the world who take British citizens hostage.
"They should know if they take British citizens as hostage we do not pay ransoms, we do not trade prisoners. They can expect a swift and brutal end."
Badakhshan provincial government spokesman Abdul Mahroof Rasikh told AFP "the kidnappers were a group of criminals with links to the Taliban".
He said they had demanded a cash ransom and the complete closure of all foreign aid agencies in Badakhshan.
Rasikh, who said the information came from local elders who were mediating with the kidnappers, did not know how much ransom was demanded, but some reports have put the figure at $4 million.
The two women were now receiving support from British embassy staff in Kabul, while the two Afghan aid workers were returning to their families in Badakhshan, the foreign office said.
"Staff from the FCO remain in close contact with Helen's family who are understandably hugely relieved at this news.
"We are also in touch with Moragwa's family and with the Afghan and Kenyan governments, and Medair have been in close contact with the families of the Afghan aid workers."
ISAF commander General John R. Allen thanked the Afghan interior ministry for its "tremendous support throughout this crisis".
He said the mission "exemplifies our collective and unwavering commitment to defeat the Taliban".
"I'm extremely grateful to the Afghan authorities and proud of the ISAF forces that planned, rehearsed, and successfully conducted this operation."
Impoverished Badakhshan has been mainly quiet but there have been pockets of Taliban-led insurgency against the Western-backed government of President Hamid Karzai.
In August 2010, the Taliban claimed responsibility for killing a group of eight medical aid workers in Badakhshan, claiming they were "Christian missionaries".
The successful rescue must have come as an enormous relief to the British government and ISAF commanders, as hostages have died in botched rescue attempts in the past.
In October 2010, British aid worker Linda Norgrove was killed by a grenade thrown by a US soldier during an attempt to rescue her from Taliban kidnappers.
And in 2009, an Afghan interpreter working for the New York Times was killed in gunfire as his British reporter colleague was rescued.
The kidnappers in the latest case were heavily armed, the ISAF spokesman said, but none of the rescuers was wounded. He could not say whether the militants had managed to fire a shot before being killed in the swift assault.