Al Shabaab said it had launched the attack near the town of Leego, in the southern Lower Shabelle region, and that it had destroyed two vehicles and had killed five members of the force.
The militant group, which wants to topple the Western-backed government and impose its strict interpretation of Islam on Somalia, has been driven out of major strongholds by African and Somali forces but continues to harass them and launch bomb and gun attacks against officials, politicians and others.
The African Union Mission to Somalia could not be reached for immediate comment.