The latest attack comes just days after al-Shabab carried out a suicide bombing near a military base in Mogadishu, the capital.
According to the defense ministry, suspected al-Shabab fighters attacked a Somali military base in the central Galgaduud region on Monday, just days after the area was captured by government forces.
The army repelled an attack on a base housing national and local troops in Qayib, a village recaptured from al-Shabab last week, according to defense ministry spokesman Abdullahi Ali Anod, who spoke to the state-run news agency SONNA.
The attack began around 5 a.m. local time (02:00 GMT), followed by hours of heavy fighting, according to Ahmed Hassan, a military officer in the nearby town of Bahdo.
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.