The attacks have been claimed by Islamist group al Shabaab
A "hellish" gun battle erupted at a hotel in the Somali capital Mogadishu after militants rammed a car bomb into the gates and stormed the building.
A second car bomb targeted the former parliament house nearby, and a third blast was reported when an attacker detonated a suicide vest at the hotel.
At least 23 people, including many policemen, were killed in Saturday's coordinated attacks, and more than 30 others were wounded.
A police commander and a former MP are also reportedly among the dead.
More than 20 people, including government officials, were believed to have been trapped as security forces battled extremists holed up on the top floor of the Nashablod Two hotel, close to the presidential palace.
One officer describing a "hellish" gun battle as security forces stormed part of the building.
The attacks have been claimed by Islamist group al Shabaab.
After the car bomb detonated after crashing into the hotel gates, a second bomb in a minibus exploded at a nearby intersection.
The second explosion "occurred at the ex-parliament house where there were (military) forces," a police officer said.
A third blast is understood to have been caused by the detonation of an attacker's suicide vest as the militants - reportedly disguised as Somali military personnel - hurled grenades and cut off the building's electricity.
According to reports, al Shabaab also broadcast a statement on its Andalus radio station, claiming: "Mujahedeen fighters are inside Nashablod Two hotel where... apostate officials are staying."
Al Shabaab, which is affiliated with al Qaeda, has killed hundreds of Somalis as it seeks to impose its strict interpretation of Islamic law.
The Nashablod Two hotel, which is reportedly owned by Somalia's interior security minister, and a local restaurant were reportedly evacuated, with wounded people among the evacuees.
The areas affected are popular with Somalia's elite and are frequented by politicians, civil servants and security personnel.
The explosion comes just two weeks after more than 350 people were killed in a truck bombing in the city, including 15 children.
A second explosion followed the larger bombing in that attack too, although in a different location.
Somalia's government also attributed that attack to al Shabaab.
The presidential palace, known as the Villa Somalia, was previously attacked by nine of the terrorist group's militants in 2014.
All of the militants were killed in the 2014 attack, as well as at least five Somali security officials.
Somalia's president Mohamed Abdullahi Mohamed has been visiting other countries in the east African region to request their support in the fight against al Shabaab following the previous attacks.
A multinational African Union force with 22,000 troops in Somalia is expected to withdraw by the end of 2020.
The US military has increased its strikes against al Shabaab this year with almost 20 drone missions against the terror group.
The Department of Foreign Affairs advises against all travel to Somalia.