A minister was killed on Wednesday when government security guards shot at his vehicle outside the presidential palace.
Abbas Abdullahi Siraji, the 31-year-old public works minister, was killed on Wednesday when government security guards shot at his vehicle outside the presidential palace.
After an emergency cabinet meeting, the prime minister's office issued a statement announcing auditor-general Nur Jimale Farah's dismissal.
"After hearing a report about the killing of minister Abas Siraji, the minister for public works, the cabinet members have unanimously agreed to discharge the National Auditor General. The position will be temporarily filled by his deputy", the statement said.
The attorney-general and police chief told cabinet that three people had been arrested over the killing and the investigation is ongoing, the statement said.
Farah rejected the sacking, telling reporters the cabinet could not dismiss him without parliament's approval. He said the three suspects who had been arrested were members of his security team.
The circumstances of the shooting are not yet entirely clear. Shortly afterwards Farah said it was "gunfire involving soldiers who had become suspicious of each other".
But this scenario has not yet been confirmed and several security officials have suggested Farah's secruity guards opened fire on the minister's vehicle fearing it could be a car bomb attack by Shabaab jihadists.
Many government officials, wealthy individuals and foreigners drive around Mogadishu with squads of armed bodyguards who are frequently nervy and trigger-happy.
Shabaab militants linked to Al-Qaeda carry out regular bombings and assassinations targeting government officials, and it is rare for a government minister to drive himself, making mistaken identity a strong possibility.
Siraji was born in Somalia but grew up and was educated in one of the world's biggest refugee camps, Dadaab in Kenya. He was elected an MP last year and became a cabinet minister in February.
His story was seen as inspiring to many in a country that has suffered conflict and anarchy for the last 25 years and his death has been widely mourned, including on social media.