MOGADISHU - A nine-man suicide commando blasted its way into Mogadishu's main court complex on Sunday in yet another Al-Qaeda linked attack.
Some militants detonated their explosive vests while others sprayed gunfire in a rampage which left 29 civilians dead. A separate car bomb attack killed five others.
The Al-Qaeda-linked Al-Shabaab militant group claimed responsibility for the courthouse attack, from which the country's chief justice escaped unharmed, on the worst day of violence the city has seen in months.
Interior Minister Abdikarin Hussein Guled said all the attackers were killed in the courthouse raid. "Six detonated themselves, and three were shot dead by security forces," he told reporters, adding that the government had regained control of the situation.
Al-Shabaab spokesman Sheikh Ali Mohamed Rage claimed only five suicide attackers died in the fighting at the court complex, and vowed there would be fresh attacks.
"This was a holy action which targeted non-believers who were in a meeting within the court complex. We will continue until Somalia is liberated from invaders," he reportedly said.
The Islamist Al-Shabaab militants used to control most of the seaside capital before abandoning fixed positions in August 2011. They have since carried out a string of attacks against the UN-backed government, however.
After Somali forces eventually ended the raid, during which a car bomb also exploded, chaos still engulfed the area and medics were seen evacuating the wounded through the courthouse's shattered windows.
"Some of the terrorists are still inside the court building and they are wearing explosive vests," a civilian trapped inside the building was reported as saying during the raid from a mobile phone.
As the drama inside the court complex was unfolding, five people were killed when a remote-detonated car bomb near the airport struck a convoy carrying Turkish aid.
"Five people, two of them women who were passing by the area, were killed in the car bomb attack," a witness said.
He said two of the bodies were charred beyond recognition.
An official from the Turkish Red Crescent confirmed to Turkish news television channel NTV that the organisation suffered casualties.
Turkey has recently taken a leading role in Somalia and is very active in reconstruction and aid projects across the country, which has been left in ruins by two decades of almost uninterrupted conflict.
A regional military offensive has forced many Shebab fighters to retreat to the mountains in northern Somalia but the insurgents have reverted to guerrilla tactics and carried out several bomb attacks in Mogadishu.
"This attack is nothing but a sign of desperation by the terrorists, who've lost all their strongholds and are in complete decline right across Somalia," Somalia's President Hassan Sheikh Mohamud said in a statement.
The courthouse is in the heavily-guarded administrative quarter of the capital and several senior officials were caught in the chaos.
"The chief justice and other senior judiciary officials are all safe and ... were rescued unharmed but unfortunately a number of civilians and security personnel were killed in the attack," police commander Mohamed Yusuf said.
Among the dead from the courthouse attack were two prominent lawyers, Mohamed Mohamud Afrah and Abdikarin Hassan, who recently defended a journalist who stood trial after interviewing a rape victim.