Heavily-armed men stormed a police station in Kaxda district in the middle of the night, exchanging gunfire with security forces.
“Terrorists using a vehicle loaded with explosives attacked the police station in Kaxda district and inflicted casualties on the civilian population around the area,” police spokesman Abdifatah Adan Hassan told reporters.
The gunmen also seized a police vehicle, he added, with officers setting off in pursuit of them.
In a second attack overnight, militants targeted the Darussalam suburb on Mogadishu’s outskirts, he said.
“Two young girls died in the incident while sixteen other civilians and three members of the security forces were wounded,” he added.
Anxious residents spent a sleepless night as the sound of gunfire reverberated across the neighbourhoods under attack, with some telling AFP the explosions caused tremors inside their homes.
“This was a horrible incident; everybody got panicked and my children started crying after the blast shook our house,” said Fadumo Idris, a Mogadishu resident.
“The heavy exchange of gunfire continued for more than 30 minutes before the situation returned to normal, we have not seen such fighting in Mogadishu recently.”
Kaxda resident Hassan Mohamud said the militants “briefly entered the police station after it was badly destroyed in the explosion, there was enforcement by the police and they later retreated”.
Al-Shabaab claimed responsibility for the attacks, saying they had targeted six locations in and around the capital.
Mogadishu has seen a spate of attacks in recent weeks as Somalia limps through a political crisis caused by long-running disagreements over delayed polls.
Somalia’s president and prime minister have been at loggerheads over the election process, which is more than a year late and has been marred by violence.
The impasse has worried Somalia’s international backers, who fear it distracts from the battle against Al-Shabaab, an Al-Qaeda-linked jihadist group which has been fighting the weak central government for over a decade.
Al-Shabaab were driven out of Mogadishu in 2011 after an offensive by an African Union force, but still control vast swathes of rural Somalia from where they launch regular attacks.