Suicide bomber disguised as a woman has killed at least 19 people, including three government ministers, in the Somali capital Mogadishu.
Officials say the attack hit a hotel in the city during a crowded graduation ceremony for medical students from a local university.
Witnesses said the attack appeared to have targeted government officials.
Islamists are fighting the UN-backed government, which only controls small pockets of territory in the country.
Somalia's President Sheikh Sharif Sheikh Ahmad described the attack as a national disaster.
Information Minister Dahir Mohamud Gelle said the male bomber had been dressed in women's clothing, "complete with a veil and a female's shoes".
The BBC's Mohammed Olad Hassan, who was at the scene, said there was a huge explosion in the hotel's meeting hall where hundreds of people were gathered for the graduation.
Five government ministers were reported to have been in the hotel at the time.
Health Minister Qamar Aden Ali, Education Minister Ahmed Abdulahi Waayeel and Higher Education Minister Ibrahim Hassan Addow were reported to have been killed.
A security official told the AFP news agency most of the dead were believed to be students. At least two journalists were also among the dead.
No-one has yet claimed responsibility for the attack, which was condemned as "inhumane and cowardly" by the African Union.
The AU said the blast would "not deter the resolve and determination of the African Union to support the people of Somalia in their quest for peace and reconciliation".
The acting head of Amisom, Wafula Wamunyini, said the blast was "intended to intimidate and blackmail" the UN-backed government.
"We want to ensure everyone we are going to continue with our mission. We are going to continue providing our services," he told AFP.
EU foreign policy chief Baroness Ashton said in a statement: "I condemn in the strongest possible terms this cowardly attack against civilians including students, doctors and journalists."
A statement signed by the United Nations, the US, the EU and the Arab League said the attack would not deter the international community from continuing its support to the Somali government.
Somalia has not had a functioning national government since 1991.
Pro-government troops regularly come under attack from the al-Shabab militant group, which is suspected of having links to al-Qaeda.