The sources said the landmine explosion targeted Ali Adow, the district commissioner of the southeastern city of Afgooye, leaving him and two his bodyguards dead.
The same explosion left two passersby injured, one of the sources said.
He added that the explosion was followed by gunfire, noting that government troops arrived in the site a short time later and closed off the area to vehicles.
There has been no claim of responsibility for the attack. The Somali government has not issued an official comment either.
Somalia has remained in the grip of on-again, off-again violence since the outbreak of civil war in 1991.