The latest attack comes within days of a suicide bombing by al-Shabab near a military base in the capital, Mogadishu.
Suspected al-Shabab fighters attacked a Somali military base in the central Galgaduud region on Monday, the defence ministry has said, days after the area was captured by government forces.
The army repulsed the attack on the base housing national and local troops in Qayib, a village captured from al-Shabab last week, defence ministry spokesman Abdullahi Ali Anod told the state-run news agency SONNA.
The attack began with two suicide car bombs at about 5am local time (02:00 GMT), followed by hours of heavy fighting, Ahmed Hassan, a military officer in the nearby town of Bahdo, told Reuters news agency.
It was not immediately clear how many people had been killed in the raid, Hassan said.
In a statement, al-Shabab spokesman Abdiasis Abu Musab said the group launched the assault in Qayib using suicide car bombs before its fighters attacked from different directions. The fighters killed several soldiers and stole weapons and military vehicles, Abu Musab said.
Government forces, supported by clan militias, have made a number of battlefield gains against al-Shabab in the last three months, regaining territory long held by the group.
In response, al-Shabab killed at least 100 people in twin car bombings at the education ministry in the capital, Mogadishu, on October 29, the deadliest blasts in five years.
A suicide bomber also killed at least five people and wounded 11 others in an incident near a military training camp in Mogadishu on Saturday.
Al-Shabab, an al-Qaeda-allied armed group fighting in Somalia for more than a decade, is seeking to topple the country’s central government and establish its own rule based on a strict interpretation of Islamic law.
Its fighters were driven out of Mogadishu in 2011 by the African Union peacekeeping forces. But it still controls swaths of Somalia’s countryside and has stepped up attacks since President Hassan Sheikh Mohamud took office in May and pledged an “all-out war” against the group.