Abdiasis Abu Musab, the group's spokesman, said that the fighters stormed the base in Baar Sanguni village - about 50km from the port city of Kismayo - after the car bomb explosion.
"We killed 27 soldiers and took the base. Some soldiers fled into the jungles," he claimed.
There was no immediate official comment from the government about the attack.
But a Somali military officer, Majo Mohamud Aden, told Reuters news agency from Kismayo that the military was sending reinforcements to the base following the reports of violence.
"We understand there was an explosion and heavy fighting between al-Shabab, who attacked the base, and the Somali forces. We have no details so far," he said.
Residents of the nearby town of Jamame, 70km away from Kismayo, said they heard the blast, followed by gunfire.
"We heard a huge blast after early morning prayers. Then heavy exchange of gunfire followed. It was in the direction of Baar Sanguni," Osman Abdullahi told Reuters.
At least seven soldiers were wounded after the Baar Sanguni base was attacked by al-Shabab fighters in June.