The Somali National Army said on Saturday that it had retained control of two bases, after attacks by Al Shabab extremists earlier in the day.
Both sides reported casualties.
The bases, about 100 kilometres south-west of the capital Mogadishu, were struck by two explosions, witnesses said.
A third explosion targeted a convoy of troops rushing to the bases from the capital after the attack, they said.
Hussein Nur, a military officer, said the army lost "several" soldiers in the attack on Bariire and Awdhigle bases.
The army sent in reinforcements from other stations, who killed an unspecified number of attackers in the ensuing fight, he told Reuters.
It was now in control of both bases and the surrounding areas, he said.
"We are pursuing the militants in the surrounding jungle," Mr Nur said.
Al Shabab claimed it launched a vehicle-borne suicide bomb attack on the Bariire base, while simultaneously attacking the nearby Awdhigle base with a car bomb and fighters, to prevent troops stationed there from reinforcing Bariire.
"We overran Bariire base, burnt three military vehicles and took two vehicles," said a spokesman from Al Shabab's propaganda unit.
A third vehicle-borne explosive device hit a convoy of reinforcement government troops coming from Mogadishu, he claimed.
The spokesman also said there had been casualties on both sides.
Al Shabab, which is linked to Al Qaeda, has waged years of attacks and levied tolls on trade in a campaign to introduce strict religious law.
Babumoshai Bandookbaaz
Director: Kushan Nandy
Starring: Nawazuddin Siddiqui, Bidita Bag, Jatin Goswami
Three stars
Tuesday's fixtures
Kyrgyzstan v Qatar, 5.45pm
The specs
Engine: 2.0-litre four-cylinder turbo
Power: 178hp at 5,500rpm
Torque: 280Nm at 1,350-4,200rpm
Transmission: seven-speed dual-clutch auto
Price: from Dh209,000
On sale: now
The President's Cake
Director: Hasan Hadi
Starring: Baneen Ahmad Nayyef, Waheed Thabet Khreibat, Sajad Mohamad Qasem
Rating: 4/5
Milestones on the road to union
1970
October 26: Bahrain withdraws from a proposal to create a federation of nine with the seven Trucial States and Qatar.
December: Ahmed Al Suwaidi visits New York to discuss potential UN membership.
1971
March 1: Alex Douglas Hume, Conservative foreign secretary confirms that Britain will leave the Gulf and “strongly supports” the creation of a Union of Arab Emirates.
July 12: Historic meeting at which Sheikh Zayed and Sheikh Rashid make a binding agreement to create what will become the UAE.
July 18: It is announced that the UAE will be formed from six emirates, with a proposed constitution signed. RAK is not yet part of the agreement.
August 6: The fifth anniversary of Sheikh Zayed becoming Ruler of Abu Dhabi, with official celebrations deferred until later in the year.
August 15: Bahrain becomes independent.
September 3: Qatar becomes independent.
November 23-25: Meeting with Sheikh Zayed and Sheikh Rashid and senior British officials to fix December 2 as date of creation of the UAE.
November 29: At 5.30pm Iranian forces seize the Greater and Lesser Tunbs by force.
November 30: Despite a power sharing agreement, Tehran takes full control of Abu Musa.
November 31: UK officials visit all six participating Emirates to formally end the Trucial States treaties
December 2: 11am, Dubai. New Supreme Council formally elects Sheikh Zayed as President. Treaty of Friendship signed with the UK. 11.30am. Flag raising ceremony at Union House and Al Manhal Palace in Abu Dhabi witnessed by Sheikh Khalifa, then Crown Prince of Abu Dhabi.
December 6: Arab League formally admits the UAE. The first British Ambassador presents his credentials to Sheikh Zayed.
December 9: UAE joins the United Nations.
WHAT IS A BLACK HOLE?
1. Black holes are objects whose gravity is so strong not even light can escape their pull
2. They can be created when massive stars collapse under their own weight
3. Large black holes can also be formed when smaller ones collide and merge
4. The biggest black holes lurk at the centre of many galaxies, including our own
5. Astronomers believe that when the universe was very young, black holes affected how galaxies formed
Who's who in Yemen conflict
Houthis: Iran-backed rebels who occupy Sanaa and run unrecognised government
Yemeni government: Exiled government in Aden led by eight-member Presidential Leadership Council
Southern Transitional Council: Faction in Yemeni government that seeks autonomy for the south
Habrish 'rebels': Tribal-backed forces feuding with STC over control of oil in government territory
Brief scores:
Pakistan (1st innings) 181: Babar 71; Olivier 6-37
South Africa (1st innings) 223: Bavuma 53; Amir 4-62
Pakistan (2nd innings) 190: Masood 65, Imam 57; Olivier 5-59