Two men disguised as government soldiers approached the Muna Hotel, killed a guard, and ran into the lobby spraying gunfire.
"Two armed men have entered the hotel, one of them blew himself up and the other one started shooting people including MPs," said a Somali police official.
"At least 36 people were killed in the shooting and suicide bombing. One attacker is still resisting, but we hope to arrest him." said police
No-one has yet claimed responsibility for the strike, but it is likely to be the work of one of Somalia's Islamist insurgent groups linked to al-Qa'eda.
Sources say the incident is one of the deadliest attack on the Somalia's government, seen by Britain and the West as the best chance to bring stability after 19 years of anarchy.