Government officials, including Somalia's prime minister, members of parliament and journalists were among those caught in the blast which targeted an event to mark the one-year anniversary of the start of a national television station.
"The blast happened as musicians were singing and spectators were clapping for them," said Salah Jimale. "Huge smoke made the whole scene go dark. People screamed and soldiers suddenly started opening fire at the gate. Some wounded people escaped and ran away."
Those killed included Somali Olympic Committee chairman, Aden Yabarow Wiish, and the president of the Somali Football Federation, Said Mohamed Nur. The deputy of the Olympic committee and the chairman for Somali boxing were both injured.
Hassan Yusuf, a local radio journalist, said he saw four dead and 20 injured people, including members of parliament, journalists, singers and students. He also saw the body of a woman whom police identified as the suicide bomber.
The International Olympic Committee said it was "shocked to hear of the terrorist attack".
"Both men were engaged in improving the lives of Somalian people through sport and we strongly condemn such an act of barbarism," the IOC said.
Safiya Sheikh Ali, a 21-year-old student, attended Wednesday's event at the theatre, and knew some of the wounded.
"Unfortunately what happened is a clear message for the government that al-Shabaab can still make explosions in Mogadishu. Just look at the National Theatre where government officials gathered and how the suicide bomber managed to enter the building," she said.
The Islamist rebels of al-Shabaab withdrew most of their fighters from Mogadishu last August, under pressure from thousands of African Union, or Amisom, peacekeepers and Somali troops. Since then, despite regular hit-and-run bomb and mortar attacks by the militants, Mogadishu's residents have begun to enjoy new freedoms and a certain degree of peace.
"It's a setback," 31-year-old Osman said by telephone from Mogadishu. "It happens all over the world. We keep on trying to live … what can we do?"
At least nine people were killed when a suicide car bomber attacked a cafe by the hotel, which itself was also stormed by al-Shabaab fighters in August 2010 in an attack that killed more than 30 people.
Despite the insecurity, Osman says he will not stay away from Somalia. He has been in Mogadishu for two months now, and usually stays six to seven months each time before returning to his family in London. "I'm glad I'm in my country," he said.
Al-Shabaab's aim is to oust the western-backed transitional government, which is widely seen as ineffective and corrupt. In the past two weeks, there have been several mortar attacks on the presidential palace, which is just 300 metres from the National Theatre.
"These attacks are disruptive and may set back efforts to develop and rebuild Somalia," said David Shinn, a former US ambassador to Ethiopia. "They will not, however, build support for al-Shabaab. On the contrary, they alienate most Somalis."
During their time in Mogadishu, al-Shabaab cracked down on any form of art they considered unIslamic, and many singers and actors fled the country. Mogadishu's rebirth has seen the return of music, dancing and men and women socialising together. But the city is still struggling to cope with hundreds of thousands of displaced people who have fled fighting elsewhere or last year's drought and famine and who live in tiny tents, their lives on hold.
Shine Ali, a singer with Kenya-based Somali hip-hop group Waayaha Cusub said he had been to Mogadishu for 10 days last month to see what conditions were like.
"I think it is so sad," he said of Wednesday's bombing. "Al-Shabaab doesn't want music or artists because they build awareness." The singer, who was shot three years ago by al-Shabaab sympathisers for urging Somalis to reject the rebels, said he did not feel safe in Mogadishu.
"The people want to see peace but al-Shabaab don't want peace. Today, you could be safe but tomorrow there will be problems."
(Additional reporting by Abdalle Ahmed in Mogadishu)