"Nineteen people, including members of the security forces and civilians, died in the blasts," said Mohamed Moalim Adan, a leader of a community militia allied with the government in Mahas, the district where the attacks took place.
Witnesses said the blasts occurred near a restaurant not far from a district administration building in Mahas.
Al-Shabab claimed responsibility in a statement issued by its media unit, saying fighters had detonated explosives at military bases in Mahas and also attacked another base in Dadan 'Ad, about 17 kilometers away, according to media monitoring group SITE.
"We were awoken this morning by two huge explosions," Ahmed Nur, a local elder, said. "We have seen many houses levelled to the ground. At least 10 people died including civilians, soldiers and macawisley fighters."
Farah Abdullahi, a macawisley spokesman for the local Mahas district, also said the blasts killed at least 10 people.
Mahas district commissioner Mumin Mohamed Halane told state radio that one bomb targeted his house and the other hit the home of a federal lawmaker.
Al-Shabaab claimed responsibility in a statement issued by its media unit according to SITE.
The insurgents have been under pressure since August when President Hassan Sheikh Mohamud launched a military offensive shortly after coming into office.
The government forces and macawisley have received support from United States and African Union troops.
The government says it has killed hundreds of al Shabab fighters and recaptured dozens of settlements, although different sides often give conflicting accounts of clashes.
Despite the offensive, al Shabab has carried out frequent attacks in recent months, including several in the capital Mogadishu against government installations and hotels.
Al Shabab's activities have also restricted deliveries of international aid, compounding the impact of the Horn of Africa's worst drought in four decades.
al-Qaeda affiliate al Shabab has been waging an insurgency against Somalia's government since 2007. It was pushed out of Hiraan last year by government forces and allied clan militias known as macawisley, but has continued to stage attacks.
This report was compiled with data from Reuters and Agence France-Presse.