At least 19 people were killed in the Somali capital on Sunday in suicide bombings and assaults by al Shabaab militants linked to al Qaeda, breaking a fragile return to peace in Mogadishu.
A bomb exploded outside law courts in the city as gunmen stormed the compound. Security forces then arrived and battled the fighters inside. Later, a bomb exploded near an African Union and Turkish Red Crescent convoy near the airport.
Al Shabaab said it carried out the attacks.
"About seven well-armed men in government uniform entered the court today as soon as a car bomb exploded at the gate. We thought they were government soldiers," said Aden Sabdow, who works at the mayor's office adjacent to the court.
"Armed men entered the court and then we heard a blast. Then they started opening fire. We do not know the number of casualties," said Hussein Ali, who works at the courts.
Government forces arrived and laid siege to the compound and there were more blasts while the two sides exchanged gunfire. Hours later, the shooting stopped, but government forces said they believed some fighters were still hiding inside.
Reuters reporters counted 16 bodies around the compound, some of them in uniform, some not, but it was not clear how many of them were government soldiers, attackers, or civilians.
Witnesses at the scene said in addition to the car bombs, three of the gunmen who stormed the court also blew themselves up using explosives strapped on their bodies.
AL SHABAAB STRIKES BACK
Security in Mogadishu has improved greatly since an African Union and Somali government offensive drove al Shabaab out of the coastal capital in August 2011.
Now its rubble-strewn streets are choked with traffic and construction sites point to a new confidence as Somalis return from abroad and invest in their homeland.
"Somalia is moving and will keep moving forward and will not be prevented from achieving the ultimate noble goal, a peaceful and stable Somalia, by a few desperate terrorists," President Hassan Sheikh Mohamud said in a statement on Sunday.
But the threat persists from al Shabaab, which still controls much of the countryside, and it has hit back this year with a series of bomb attacks.
"We carried out a superb intense mission in Mogadishu today. We killed 26 people including soldiers and court staff," said al Shabaab spokesman Sheikh Ali Mohamud Rage.
"We assigned five special mujahideen for the court - four of them entered and killed the people inside. The other mujahid with his car bomb exploded when government soldiers gathered at the gate."
Al Shabaab routinely inflates the number of people it kills.
Soldiers managed to rescue the Supreme Court chairman and other officials. Some climbed down ladders against the walls.
Later, a car bomb exploded at a building housing Somali intelligence along the road to the airport as Turkish and AU vehicles were passing, police and witnesses said. Government forces then opened fire and blocked the road.
"I saw three dead people including a man, a woman and a child. The ruined car bomb is in the middle of the road," said Hussein Bile.
"The explosion occurred here, the car with the bomb targeted Turkish vehicles and hit the last car of the convoy, two Turks died while two women passersby were also killed," said Abdifatah Canjex, a district police officer.
Another Somali police officer said there were Turks among the dead. But a Turkish official who spoke on condition of anonymity said a Somali driver was killed and three Turkish passengers were wounded in the attack.