Annetta Flanigan from Northern Ireland, Philippine diplomat Angelito Nayan and Shqipe Hebibi of Kosovo were found early Tuesday after apparently being abandoned by their captors in Kabul, the capital.
A militant group linked to the ousted Taliban regime had claimed to be holding the trio since they were seized from a Kabul street on Oct. 28. It was the first such attack on foreigners since the Taliban fell in late 2001, and suggested the regime's supporters were adopting the tactics of Iraqi insurgents.
The three, who helped organize Afghanistan's Oct. 9 presidential elections, were preparing to fly home Wednesday after getting the all-clear from doctors in Kabul.
The release prompted jubilation among officials, fellow aid workers in Kabul's 2,000-strong expatriate community and relatives in the hostages' home countries.
But tracts of Afghanistan are still off-limits to aid organizations because of a stubborn Taliban-led insurgency. Already this year, 24 aid workers have died in violence.
U.N. Secretary-General Kofi Annan, who spoke to the three released workers, said he was "profoundly relieved" their ordeal was over.
He said the world body would need to "strengthen the security of its staff in order to enable it to fulfill the organization's mandate to further peace, reconstruction and democracy in Afghanistan."
Paul Barker, the head of CARE International, one of the largest relief groups in Afghanistan, welcomed the peaceful outcome of the kidnapping but said it was unlikely to prompt aid groups to return to the troubled south and east of the country.
"Had it not ended this way, it would have been a big setback to a lot of reconstruction efforts here," Barker said. "There are still plenty of serious incidents in all corners of the country."
Afghan officials said investigations into the kidnapping were continuing and did not release details or suspects' identities.
Officials had said they suspected a criminal group of kidnapping for ransom, although the militant group Jaish-al Muslimeen, or Army of Muslims, had claimed to be holding the three workers and demanded the U.S. military release jailed comrades.
Syed Khalid, a spokesman for the militants, told The Associated Press on Tuesday that Jaish-al Muslimeen freed the hostages in exchange for "assurance that the release of our 24 people would begin today."
But Interior Minister Ali Ahmad Jalali told reporters that neither a ransom nor prisoners were being handed over in return for the hostages' lives.
Jalali said discussions had been held with the kidnappers, whom he declined to identify, but insisted no deal was done and that the releases were unconditional.
"None of the hostage-takers conditions have been met," he told a news conference. "All those people who had a hand in this — directly or indirectly — will be brought to justice."
In Kabul, U.S. Ambassador Zalmay Khalilzad hailed the releases as a "major defeat to terrorists who wanted to export an Iraq style of hostage-taking in Afghanistan."
Afghan Interior Minister Ali Ahmad Jalali said the trio were "abandoned in one location inside Kabul" at around 6 a.m. Tuesday.
Jalali also said one person was killed and four injured in another police operation linked to the kidnapping north of Kabul on Monday. He declined to give details, saying it could endanger efforts to round up more suspects.
Philippine Foreign Undersecretary Jose Brillantes told Manila radio DZMM from Kabul that he talked with Nayan.
He said Nayan spoke by phone to his sister in Manila and had an "emotional telephone conversation" with President Gloria Macapagal Arroyo. He "was a bit apologetic" that everyone had to go through so much trouble, Brillantes said.
The British government released a statement by Flanigan's family expressing their joy at the peaceful end to the crisis and their thanks to the authorities.
"After all the terrible anxiety of the last 27 days it is an incredible relief to know that Annetta is safe and well."
In Flanigan's native Richhill in Northern Ireland where her mother and siblings live, the Rev. David Coe said "the entire village has been praying for her release, and thank God it's happened. It will be a happy Christmas for the family after all."
Jalali appealed to Afghanistan's international backers not to lose their nerve in the face of the kidnapping which "must not be repeated and will never be tolerated."
"We hope it will not discourage the resolve of the international community to continue their work to assist the Afghan people in the pursuit of lasting peace and security," he said.