The first car bomb went off in the early evening, followed soon after by as many as five gunmen approaching from the beach. A second car bomb went off half an hour later, BBC Somali reports.
One report said at least three people had died. The toll is feared to rise.
Al-Shabab said it was behind the attack and its fighters were still in one of the cafes.
The Somali Prime Minister, Omar Abdirashid Ali Sharmarke, condemned the attack as “barbaric”.
There are varying reports about how the attack started but it appears that as the first car bomb went off, at around 19:30 local time (16:30 GMT), the gunmen stormed the area.
The Beach View and Lido Sea Food restaurants were targeted, Abdirahman Koronto from the BBC’s Somali service reports.
A police officer at the scene told Reuters news agency the gunmen were “still inside” one of the restaurants. “We cannot know the number of casualties inside,” Major Farah Abdulle said.
Al-Shabab spokesman Sheikh Abdiasis Abu Musab told Reuters: “We are inside and control the cafe. There are many casualties lying inside and outside the cafe.”
After the evening prayer, I went to Lido beach, in particular Beach View restaurant. When I was there about 30 minutes, and I was spending time with my friends including journalists, we saw bullets raining on us.
A good number of people were seated around me, there was a wedding ceremony at the hall of the restaurant. We started running towards the door, but before I reached we heard a loud explosion.
I saw some people jumping from second floor. Bullets were flying all over the place, and there was another explosion. Then everyone got confused. I personally saw three wounded people. I did not see those who have been harmed by the explosions. I think the car was parked near the main door of the restaurant.
Lido Beach, on the northern edge of Mogadishu, attracts thousands of mostly young Somalis looking to relax and enjoy the beach and the surf.
Several restaurants have opened up along the beach front in recent years, and people would have been sitting out in front of them when the attacks began.
Al-Shabab, which has links to al-Qaeda, has carried out similar attacks in the past. The group was ousted from Mogadishu in August 2011, but still has a presence in large areas of southern Somalia and frequently targets the capital.
The group stormed an African Union military base last week in southern Somalia,killing dozens of Kenyan troops.
BBC/London