The attack began when five heavily armed gunmen overpowered security guards and stormed the upscale SYL hotel, according to police and government officials.
Eleven people were injured, including two members of the country’s security forces, police said.
The attackers, claimed by terrorist group Al-Shabaab, began shooting at responding Somali security forces, said police officer Ali Abdi.
All five attackers were killed in the firefight, officials said.
Dozens of people were evacuated from the hotel, he also said. The SYL is close to the presidential palace and is popular with Somali lawmakers and security officials, according to local police.
Hassan Ahmed, who was in a nearby building when the attack unfolded, told CNN he heard the sound of explosions coming from inside the hotel.
Police warned the death toll could rise.