The aid workers were abducted on July 16 near the city of Baidoa 250 kilometers (155 miles) southwest of the capital Mogadishu.
Mohamed Isak Ibrahim, National Intelligence and Security Agency (NISA) director in Baidoa, told Anadolu Agency by phone that seven aid workers had been released by al-Shabaab on Monday.
"Seven local humanitarian workers were freed on Monday and they came in Baidoa city safely. Theere are two women and five men" Isak said.
The hostages were released after the kidnappers received weapons as a ransom, a police officer told Anadolu Agency speaking on condition of anonymity due to restrictions on taking to the media.