The three employees of the French agency Action Against Hunger (ACF) were being flown to Nairobi from Somalia, the agency told the BBC.
They are said to be in good health and having medical checks before being reunited with friends and family.
It was not clear if a ransom was paid for the release of the hostages, who were seized in a cross-border raid.
About 10 gunmen were reported to have taken them from their office in Mandera, a remote area on the Kenyan border, on 18 July.
Residents in the north-eastern town said at the time that two of the hostages were from Zimbabwe and Pakistan, while the third was listed as European.
Aid workers and journalists in the area are particular targets for kidnappers and are often released after ransoms are paid.
Somalia has not had a functioning national government since 1991.
Moderate Islamist Sheikh Sharif Sheikh Ahmed was sworn in as president in January after UN-brokered peace talks.