The al Shabaab militant group said it was behind the attack on the Beach View Cafe on Mogadishu's Lido beach.
"We are inside and control the cafe," Sheikh Abdiasis Abu Musab, the group's military spokesman, said.
"There are many casualties lying inside and outside the cafe."
There are reports a second eatery, the Liido Seafood restaurant, was also attacked. It is popular with Mogadishu's elite and government officials.
The first car bomb went off around dusk, police said, before the second blast about an hour later.
Government forces went into the restaurant after the first explosion.
Major Farah Abdulle, a police officer at the scene, said: "We cannot know the number of casualties inside."
Al Shabaab, who are fighting to overthrow the internationally-backed government in Mogadishu, regularly carry out attacks in the capital.
Last week, the insurgents stormed a Kenyan army base in southwest Somalia.
Posted by Women Against Shariah on Friday, January 22, 2016
From Sky News: