It was not immediately clear who was responsible for the blast, but the Islamist insurgent group al Shabaab frequently carries out bombings in the capital and elsewhere.
The group is allied with al Qaeda and wants to rule Somalia according to its strict interpretation of Islamic sharia law.
The Gelato Divino parlor is located near K4 Junction in the heart of Mogadishu, near the international airport.
"A suicide bomber blew up himself in the ice-cream restaurant," information ministry spokesman Ismail Mukhtar Omar said. "Six people died and eight others were injured."