"It has been confirmed to me by the local authority that two of our soldiers were killed outside Garbahaarreey," Mohamed Osman, a National Security official, told The Anadolu Agency.
Al-Shabaab militants reportedly killed the soldiers by firing squad a few kilometers outside the town.
In the past, the militant group has used this method to execute suspected spies.
The two soldiers were brothers who had reportedly come to Garbahaarreey last week to visit relatives when they were seized by Al-Shabaab operatives.
Pockets of Gedo, which borders Kenya, remain under the militant group's control, while the rest of the region is held by Ethiopian and Somali troops.
According to the Somali government, 131 people were killed in attacks by Al-Shabaab in 2014, representing a considerable drop in casualty rates since 2006.
Somalia has remained in the grip of on-again, off-again violence since the outbreak of civil war in 1991.
Earlier this year, the country appeared to inch closer to stability after government troops and African Union forces – deployed in the country since 2007 – drove Al-Shabaab from most of its strongholds.