Islamist gunmen have stormed a hotel close to Somalia's presidential palace and killed at least 32 people, including six MPs.
The BBC's Mohammed Olad Hassan in Mogadishu says the men were disguised as government soldiers.
They approached the Muna hotel, opened fire on a guard, then one of them blew himself up inside the building.
Sheik Ali Mohamud Rage from the al-Shabab Islamist militia said its "special forces" were behind the raid.
The hotel attack comes on the second day of heavy fighting between al-Shabab and troops of the transitional government, who are backed by the African Union (AU).
Our correspondent says the Muna hotel is popular with government officials, because it is in a government-controlled area and security was seen as tight.
Deputy Prime Minister Abdirahman Ibbi told the BBC Somali Service that the suicide attacker had blown himself up using a hand grenade.
As well as the six MPs, five government officials and 21 civilians were also killed.
Maj Barigye Bahoku, spokesman for the African Union peacekeepers, said an 11-year-old shoe-shine boy and a woman selling tea in front of the hotel were among the dead.
An MP at the Muna hotel told a BBC reporter that there were "dead bodies all over" and the scene was a "massacre".
He said the gun battle at the hotel had lasted about an hour.
"They rained gunfire on everybody. Nobody stood a chance. I was lucky because they aimed at me but I jumped out of the window and survived," hotel employee Adan Mohamed told the AFP news agency.
Mr Ibbi called the attack "shocking and brutal", especially given that it had happened during the Muslim holy month of Ramadan.
Al-Shabab launched a new offensive on Monday soon after its spokesman said the group was declaring a "massive war" on the AU force, describing its 6,000 peacekeepers as "invaders".
At least 40 other people have been killed in the fighting and more than 130 wounded, with shells being fired into residential areas, according to health officials.
The government controls only a few key areas of the capital.
The group said it carried out last month's deadly twin bombings in Uganda's capital during the football World Cup final.
They were in retaliation for Uganda's deployment of troops to Somalia with the African Union force, it said.
The AU has responded by saying it will send extra troops to bolster its force in Mogadishu.
Somalia has experienced almost constant conflict since the collapse of its central government in 1991.