"The second blast was very big," witness Idil Hassan told AFP. "I saw the dead bodies of several people, including members of the security forces."
Another witness, Osman Fahiye, said a leading official from Banadir, a region which surrounds Mogadishu, was hurt in the second blast.
"He was lightly wounded but several of his security guards were killed in the blast," said Fahiye.
"We have confirmed seven people died in the two blasts and more than 10 others were wounded," said police spokesman Ibrahim Mohamed. "The security forces have cordoned off the area and an investigation is ongoing."
Somalia's London-based Universal TV said three of its staff were among the dead. The company named one as Somali and British dual national Awil Dahir
A Shabaab statement said the Islamist group's "martyrdom operation" had targeted a security checkpoint that used to protect the presidential palace.
Shabaab was largely driven out of the capital in 2011 and has lost many of its strongholds. But it retains control of large rural swathes of the country and continues to wage a guerrilla war against the authorities.
The group says it wants to topple the internationally-backed government.