Somalia's security minister has been killed in a suicide bombing at a hotel in Beledweyne, just north of the capital, Mogadishu, according to the country's information minister and witnesses.
Somalia's ambassador to South Africa and at least nine other people were also thought to have been killed in the blast on Thursday, reports said.
Farhan Ali Mohamud, the information minister, announced the death of Omar Hashi, the security minister, but declined to give any other details.
Ibrahim Maow, the head of the pro-government Islamic Courts forces, said in Beledweyne that Somalia's former ambassador to Ethiopia, Abdulkarim Ibrahim Lakanyo, was among the dead.
Abdi Sheikh Guled, a local elder, told the AFP news agency: "The death toll is now at 20, including senior government officials and security forces who were guarding the minister."
Hashi had moved to Beledweyne at the beginning of June with heavily armed troops in an attempt to regain territory from fighters of the al-Shabab group.
A doctor from a nearby hospital said that most of the dead had been burnt beyond recognition.
The latest round of fighting has claimed the lives of around 300 civilians and has sent over 120,000 people fleeing Mogadishu since early May.
Mogadishu's police chief, Colonel Ali Saed, was among those killed on Wednesday as government forces attempted to dislodge the fighters from positions in the city's south.
Sheikh Sharif Sheikh Ahmed, Somalia's president, blamed the Beledweyne attack on foreign "terrorists who do not want the Somali flag to fly over this nation".
He has repeatedly warned of a risk of al-Qaeda setting up a "strategic zone" for its network in Somalia, through its backing for al-Shabab.
Al-Shabab later confirmed that one of its "holy warriors" had carried out the attack.
"One of our mujahidins went with his car laden with explosives to a building where the apostate and other members from his group had been meeting," Ali Mohamoud Rage, al-Shabab spokesman, said in Mogadishu.
"The apostates have been eliminated, they all died in the suicide attack."
Commenting on Hashi's killing, Mohamed Omaar, Somalia's foreign minister, told Al Jazeera: "It is the loss of a courageous leader. But it is a loss that we will overcome and make up for by defeating those that killed him and those that wish to destroy Somalia."
He said al-Shabab "has tried to take the capital over the last six weeks [but] they have failed completely ... we have pushed them back".
Omaar said the government will be able to hold on to its gains in Mogadishu "because the Somali public are tired of twenty years of conflict and are in favour of peace".
Al-Shabab has so far resisted government attempts to drive its fighters from Mogadishu.
The fighters, along with the allied group Hizbul Islam, control most of southern Somalia bordering Kenya and parts of the central region.
Beledweyne is the capital of the central region of Hiran, which is close to the border with Ethiopia.
Somalia has not had an effective government since 1991 when former Mohamed Siad Barre, the former president, was overthrown, plunging the country into chaos.