Al-Shabab gunmen forced their way into a hotel in the Somali capital, exchanging fire with hotel guards before government security forces ended the attack.
Five militants and at least nine civilians were reported killed.
Captain Mohamed Hussein said a suicide bomber rammed his car into the SYL hotel's entrance in Mogadishu on Friday night and blew it up, allowing gunmen to fight their way past hotel guards at the first security barrier.
Four gunmen and the suicide bomber were killed, he said, adding that the attackers did not get past the last security checkpoint. In addition, he said at least nine bodies of civilians could be seen outside the hotel.
The Islamic extremist group Al-Shabab claimed responsibility for the attack.
The SYL hotel, which is located across from the presidential palace in Mogadishu, is frequented by government officials and business executives.
Despite being pushed out of Somalia's major cities and towns, al-Shabab continues to launch deadly guerrilla attacks across the Horn of Africa, and even across the border. Al-Shabab has carried out attacks on three of the five countries contributing troops to the African Union peacekeeping mission in Somalia.
The al Qaida-linked group has carried out many deadly attacks inside Kenya as well, including one in 2013 on the Westgate Mall in the capital Nairobi in which 67 people were killed.