Abbas Abdullahi was killed when the bodyguards of the country's auditor general, Nur Farah, opened fire on his vehicle.
Bodyguards for Somalia's auditor general shot dead a government minister near the presidential palace on Wednesday evening after mistaking him for a militant, officials said.
Mogadishu mayoral spokesman Abdifatah Omar Halane said the public works and reconstruction minister, Abbas Abdullahi Sheikh Siraji, who was also a lawmaker, was killed "by mistake - they opened fire on his car accidentally. May God rest his soul."
Police Major Nur Hussein told Reuters that security forces on patrol encountered a car blocking the street, believing it to be driven by militants.
Capt. Mohamed Hussein said bodyguards escorting auditor general Nur Farah opened fire on the car near a checkpoint close to the palace. The palace has been targeted by the Al Qaeda-affiliated al Shabab group with suicide car bombings and other attacks in the past.
But according to Hussein's account, the car carrying the minister approached and trailed the auditor general's car, promoting his bodyguards to open fire, Hussein said. The minister's bodyguards fired back.
Another minister who was in the car with the deceased minister survived, Hussein said.
Somalia's new cabinet was sworn in in late March after President Mohamed Abdullahi Mohamed was elected in February.
The minister who was killed, a former refugee who spent large parts of his life at a camp in Kenya, had been the youngest member of Somalia's new cabinet.
The new president has vowed to improve security in this Horn of Africa country, which has seen a quarter-century of chaos.