Two civilians were killed during a drive-by shooting by Shebab militants in central Mogadishu while a third died when the car later exploded after police gave chase firing their weapons.
One Shebab gunmen was killed and two more are on the run, according to police.
"A Shebab gunman was killed by police after he killed a civilian. Another civilian was killed after the car the assailants were riding in detonated," said police official Ibrahim Mohamed.
The third civilian victim died later of gunshot wounds.
"I saw the dead bodies of a woman and one of the gunmen who was riding in the car. He was shot after exchanging fire with police. Their car exploded after they abandoned it during the fighting," said witness Dahir Abdulaziz.
Somalia's Al-Qaeda aligned militants were pushed out of the capital in 2011 but continue to carry out attacks on military, political and civilian targets aimed at undermining the internationally-backed government.