Somalia's Security Minister Omar Hashi Aden has been killed in a suicide car bomb attack north of the capital Mogadishu, witnesses and officials say.
Somali diplomats were also reportedly among at least 10 people killed in the blast at a hotel in Beledweyne.
Somalia's president blamed al-Shabab - accused of links to al-Qaeda - which later claimed the attack.
Al-Shabab is among militants who have been trying to topple the fragile UN-backed government for three years.
On Wednesday, at least 10 people died when a mortar hit a Mogadishu mosque. The city's police chief was killed in a separate attack.
'Invaded by terrorists'
In Thursday's blast, witnesses said a suicide bomber detonated an explosives-laden vehicle at the Medina Hotel in Beledweyne, some 400km (249 miles) north of Mogadishu.
Most of the victims were burnt beyond recognition after the explosion, a local medic was quoted as saying by the Associated Press news agency.
Abdulkarim Ibrahim Lakanyo, a former Somali ambassador to Ethiopia, was reportedly among those killed in the blast.
Mr Aden had recently moved to Beledweyne, a town close to the Ethiopian border, in an effort to stop Islamist insurgents gaining more ground in Somalia, the BBC's Will Ross in Nairobi says.
Somali President Sheikh Sharif Sheikh Ahmed told a news conference in Mogadishu: "As you see this country was invaded by terrorists who do not allow for the existence of the Somali national flag, its sovereignty and any peace to this country.
"This group is hiding under the cloth of Islam. You know that a lot of foreigners are pouring into the country day by day," he added, in an apparent reference to Islamist fighters from overseas he has previously warned are entering Somalia to join the insurgents.
Somali Prime Minister Omar Abdirashid Ali Sharmarke told the BBC's Focus on Africa programme the transitional federal government was still in control but urged the international community to help "before it is too late".
The failed Horn of Africa state has not had an effective national government since 1991 and some four million people - one-third of the population - need food aid, aid agencies say.
Pro-government forces have been locked in ferocious battles with radical Islamist guerrillas in Mogadishu since the second week of May.
The UN refugee agency's representative to Somalia, Guillermo Bettocchi, said on Wednesday the recent bout of bloodletting in the country was the "worst ever" in nearly two decades of chaos.
But Ahmedou Ould-Abdallah, the UN special representative for Somalia, denied on Thursday that the conflict was getting worse.
"The president and prime minister have been put in place in January and February. It is not even six months, so you will not have total peace after two decades of violence overnight," he told Focus on Africa.
"These people [Islamist guerrillas] tried around 7 May to take power by force; they have not been able to do it. That they have resorted to suicide bombs or killing, there is nothing any country can do against these kind of people, but this is different from taking power."
President Ahmed, a moderate Islamist, took office in January but even his introduction of Sharia law to the strongly Muslim country has not appeased the guerrillas.