A Somali group that kidnapped a British aid worker released the man on Wednesday after clan elders intervened, a spokeswoman for Save the Children said.
Save the Children is "cautiously optimistic" that Frans Barnard will soon be out of Somalia, spokeswoman Anna Ford said. The group has spoken to Barnard twice and Ford said he is "well" and in good spirits.
"It was down to the clan elders. They negotiated and organized his release," Ford said. "It's just a testament to Somali society that they were able to do this following traditional methods and we are obviously extremely grateful to them.
"The clan elders invited Save the Children into the community to do the work that we do and they saw Frans as a guest," she said.
Barnard, who is in his late 40s, was carrying out an assessment for Save the Children on the feasibility of setting up a program to feed malnourished children in the Adado area, near the Ethiopia border. Masked gunmen abducted the Briton and a Somali co-worker on Oct. 14 from a compound. The Somali was released earlier.
The head of the local Himin and Heeb administration, Max'ed Adan Ti'ey, said no ransom was paid for Barnard, whom he said was not harmed during his captivity.
"After a lot of efforts we have finally succeeded in freeing the aid worker from the hostages. He is now at our guest house and will soon go to wherever he wants," he said.
A statement from Save the Children said the group believes Barnard was abducted by an independent group of criminals with no political affiliation or support from other groups in the region. It also said no ransom was paid.
Save the Children said it has worked in Somalia for 40 years and will continue to work there.
Several forces have gunmen in the Adado area, including pirate gangs and factions of militias allied to the government. The area was considered to be a safer part of Somalia and some aid agencies, which have mostly pulled out of the chaotic country, were considering returning.
Kidnapping for ransom is common in Somalia, which has not had an effective government for 19 years. Hostages are rarely hurt and people are usually freed after a ransom is paid.
Barnard's abduction took place in the same region that pirates hold a retired British couple, Paul and Rachel Chandler, who have been in pirate custody ever since their yacht was hijacked off the Seychelles last October.
Associated Press reporter Mohamed Olad Hassan in Nairobi, Kenya contributed to this report.