"Both men freely confessed to the killings, therefore, after the due process of the law, the military court sentenced them to death," Minister of Information Mustafa Duhulow told reporters.
The extremists confessed to killing journalist Mohamed Mohamud Timacade, a reporter with London-based Somali-language Universal TV, in October 2013, the minister said, adding the sentence was handed out on Monday.
Timacade was shot several times in the neck, chest and shoulder when the attackers sprayed his car with bullets. The gunmen also killed a security guard.
It was not clear if the men had yet been executed by firing squad, but in Somalia, death sentences are often carried out shortly after they are issued.
More From This Section
Attacks on journalists are often blamed on Islamist Shebab fighters battling the internationally backed government, but some are also believed to be linked to a settling of scores within the multiple factions in power.
Journalists also face threats from the government itself.
Three senior Somali journalists from Radio Shabelle and its sister station Sky FM are currently awaiting trial for broadcasts allegedly inciting violence.