"The attack was started with a heavy explosion and members from the Mujahedeen fighters stormed the building," the Shabaab said in a statement.
The explosion at the Ambassador Hotel on a busy road in the heart of the city was followed by a "complex attack", a security source told AFP.
"A VBIED (vehicle-borne improvised explosive device) exploded at the Ambassador Hotel, Makkah Almukarramah street," the source said.
Somali security official Abdirasak Ahmed said there was "one civilian casualty" but witnesses said many people had died.
"I was a few metres away from the hotel when the blast occurred. It was very heavy one and it destroyed the whole area. I saw the dead bodies of seven people most of them burned," Mohamed Elmi said.
Another witness, Ibrahim Sheikh Nur, added: "I saw several dead bodies outside the hotel but we don't know how many people are inside and the casualties there. The security forces are now inside and the whole area is cordoned off."
They jihadists are fighting to overthrow the country's internationally-backed government.
Today, the United States said a top Shabaab military leader Abdullahi Haji Da'ud was "presumed killed" during a May 27 air strike.
