At least six people, including two of Somalia's top sports officials, have been killed after a female suicide bomber struck a ceremony at Mogadishu's national theatre.
Al-Shabaab insurgents claimed responsibility for the blast that killed the heads of Somalia's football federation and Olympic committee.
The bombing was an apparent attempt to kill the prime minister as he spoke at an event to mark the first anniversary of the country's new satellite television channel.
While the al-Qaeda-allied militants pulled their fighters out of the capital last August, they have struck targets regularly in the heart of the coastal city using roadside bombs, mortars and suicide bombers.
A soldier guarding the newly-opened theatre said the bomber had been stopped but the premier's security team had insisted she be allowed in because she was carrying police ID.
"The prime minister was speaking inside the theatre when the blast took place, but he is safe, unhurt," Gilbert Nitunga, deputy spokesman for the AU's AMISOM force, said.
The African Union, which also identified the bomber as a woman, said six people were killed and 12 wounded.
A doctor at the Madina hospital said two ministers and a member of parliament were among those hurt.
Al-Shabaab said it had targeted government officials and politicians with explosives planted ahead of the event, and denied that it had used a suicide bomber.
"We were behind the theatre blast. We targeted the infidel ministers and legislators, and they were the casualties of today," Sheikh Abdiasis Abu Musab, the spokesman for al-Shabaab's military operations, told Reuters.
The attack comes ahead of a planned political transition in Somalia, with the Western-backed government's term due to end in August.