An ambulance carrying a victim from an attack by Al-Shabaab gunmen on a hotel near the presidential residence arrives at the Shaafi hospital in Mogadishu.
Mogadishu, Somalia CNN  — 

Security forces ended a deadly attack at a hotel in Somalia’s capital Mogadishu on Tuesday after a seven-hour battle that left at least three civilians and two soldiers dead.

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.

“The security forces have finally accomplished the operation they have been conducting in SYL hotel, the entire of the 5 attackers have been killed, (and) 5 people have been killed in the attack,” government spokesman Ismail Mukhtar tweeted early Wednesday.

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.

Al-Shabaab has claimed responsibility for the attack, saying in a statement its fighters conducted the raid as planned. CNN could not confirm the claim.

Police warned the death toll could rise.