Al Shabaab terrorists launched a similar assault on a Somali military base on Monday in which at least five soldiers died.
The toll from the hotel attack included 11 victims and five assailants, Ismail Mukhtar Omar said in a tweet late on Sunday, adding: "Security forces lost one."
Terrorists detonated a car bomb at the high-end Elite Hotel in Lido beach before opening fire with assault rifles.
Mohamed Ibrahim Moalimuu, who was present during the attack, told Reuters security at the hotel, which is owned by a government politician, was considered extremely tight, with two checkpoints inside the compound and two outside.
"No one can enter that area without a government ID card. It is impossible for car bombs or even civilian cars just to go in there," Moalimuu said.
At the moment the car bomb exploded, he said, "there was a blanket of flame hovering over us ... The hotel was like hell. Clouds of smoke, terrible exchange of gunfire, flames."
Moalimuu was able to jump over a wall and escape on to the beach, he said, but the friend he was dining with was killed.
Footage of the security response shared with Reuters by a security source shows Somali soldiers helping guests climb down ropes strung from hotel windows, and jubilant soldiers chanting "Allahu Akbar" -- "God is greatest" -- over the bloodstained bodies of three men sprawled in a stairwell.
Aamin ambulance services helped 43 people injured in the attack, its head Abdikadir Abdirahman told Reuters on Monday.
The hotel is owned by Abdullahi Mohamed Nor, a lawmaker and former finance minister, and is popular with government officials and members of the Somali diaspora.
Al Shabaab has been battling the central government since 2008. The insurgents want rule based their own strict interpretation of Islamic sharia law.
On Monday, five soldiers were killed after fighters from the group launched a car bomb and gun assault on a Somali military base in the Goofgaduud area, about 30 kilometres from the town of Baidoa in Somalia's southwest.
Three soldiers were killed when a suicide car bomber rammed the gate to the base, Major Mohamed Aden, a military officer in Baidoa told Reuters.
Soldiers abandoned the base and al Shabaab fighters entered it, planting a booby-trap bomb on one of the dead men which killed two more soldiers when it exploded, he said.
Al Shabaab's military operations spokesman Abdiasis Abu Musab told Reuters the attackers had killed eight soldiers, including the base commander.Somalia has been embroiled in civil war since 1991, when clan warlords overthrew leader Mohamed Siad Barre and then turned on each other.
MOGADISHU - terrorists stormed a high-end seaside hotel in Mogadishu on Sunday, killing at least seven people and wounding more than 20 as they detonated a car bomb then opened fire with assault rifles in the latest attack in the Somali capital.
Islamist insurgent group al Shabaab said it was behind the assault on the Elite Hotel in Lido beach, and that its gunmen battled security forces who rushed to the scene.
At about midnight, state news agency SONNA said the operation was over and that 205 people had been rescued, "including ministers, lawmakers and civilians," citing Farhan Qarole, a security forces commander at the hotel.
"All the four terrorists armed with AK-47 were shot dead. They were aboard the car bomb, they got off ... and the four terrorists went in the hotel to fight," SONNA said, adding that full details of casualties will be given later.
The hotel is owned by Abdullahi Mohamed Nor, a lawmaker and former finance minister, and is frequented by many government officials and members of the Somali diaspora.
"There were officials of (President Mohamed Abdullahi Farmaajo's) government inside the hotel when we attacked," said a statement broadcast on al Shabaab's Radio Andalus.
The attack follows an uprising at Mogadishu's central prison on Monday. SONNA said at least 15 prisoners and four guards were killed when security forces beat back the rebellion.
A witness, Ahmed Ali, said on Sunday he had heard "a huge blast at the hotel, gunfire followed, and then clouds of smoke."
"So far we confirmed seven people died, including two attackers, two junior directors and three civilians," information ministry spokesman Ismail Mukhtar Omar told Reuters.
"Fifteen people were injured," he added.
Aamin ambulance service head Abdikadir Abdirahman had earlier told Reuters the service had transported 28 injured people from the scene before exchanges of gunfire started.
Hotel owner Nor posted on Facebook after escaping the building: "May Allah have mercy on all those who died in the attack by the terrorists on civilians particularly on Elite Hotel in which I was in."
Mohamed Nur, a government worker who lives near Lido beach, said the exchange of gunfire was "terrible."
"Stray bullets reached us near the beach," he said.
Somalia has been embroiled in violence since 1991, when clan warlords overthrew leader Siad Barre and then turned on each other.Since 2008, al Shabaab has been fighting to overthrow the internationally-recognized central government and establish its rule based on its own interpretation of Islamic Sharia law.