The al-Shabab terrorist group has claimed responsibility for the explosions, Somalian news outlet Garowe Online said.
Following the explosions, the two ministerial buildings were besieged by heavily-armed militants.
A number of people, mostly government workers and officials, are currently trapped in the building, while the terrorists and security forces exchange fire inside the compound.
At least 5 people were killed, including the deputy labour minister, in an attack by Islamist extremists, AP reports, citing Somalia police.
Gunfight between Somalia security forces and militants in the capital Mogadishu have ended, and the death toll rose to 15, according to police reports.
Al-Shabab emerged in Somalia in 2006 and has claimed numerous terrorist attacks throughout the region. The group has sworn allegiance to the al-Qaeda terrorist organization (banned in Russia).