Thursday's bombing ripped through a university graduation ceremony at an upscale hotel in the Somali capital, killing medical students, doctors, journalists and three government ministers.
Somalia's most powerful Islamic militant group said Friday it was not responsible for the attack, but Security Minister Abdullahi Muhammad Ali blamed al-Qaida through their affiliation with al-Shabab.
"The investigation is still under way to uncover evidence of who might have been behind the attack, but we already know that this is the work of al-Qaida through their affiliated group al-Shabab, because of the nature of the attack and the tactics used," said Ali.
Al-Shabab spokesman Sheik Ali Mohamud Rage denied the accusation.
"We had nothing to do with the attack and we are very sad about it," he said.
He blamed the government for carrying out the attack. Somalia's prime minister has strongly condemned the bombing, saying it was an outrage to kill those "whose only aim in life was to help those most in need in our stricken country."
Government officials on Friday buried three Cabinet ministers killed in the bombing.
President Sheik Sharif Sheik Ahmed is calling the bombing an imported idea to prevent Somalia from achieving peace.
Al-Shabab has claimed responsibility for past suicide attacks in Somalia, and has never denied carrying out an attack. But militant groups tend to distance themselves from bombings that kill large numbers of civilians — attacks that could draw popular outrage.
The bombing of a graduation ceremony for medical students and other graduates in a country that needs as many doctors as it can get drew swift condemnation from around the world.
Islamic militants in Somalia have shown a rising ability to carry out sophisticated large-scale bombings against high-profile targets. The bombing also highlighted the inability of Somalia's weak government to protect even the small section of the capital it controls.
African troops protecting the weak Somali government wage near daily battles with Islamic militants who hold much of central and southern Somalia. The government holds only a few square blocks in Mogadishu, though that didn't prevent Thursday's suicide bomber from gaining entry into the ceremony.
Several hundred people had gathered in the Shamo Hotel to watch the 43 medical, engineering and computer science students from Benadir University receive their diplomas when the blast ripped through the festively decorated ballroom.
The bomber "disguised himself as a woman, complete with a veil and a female's shoes," said Somali Information Minister Dahir Mohamud Gelle, who confirmed that the ministers for education, higher education and health were killed in the blast.
Amateur video of the attack obtained by AP Television News showed the dead, including at least three journalists, lying in pools of blood amid the sound of wails and screams from the wounded. Soldiers, their AK-47 rifles slung over their shoulders, picked through the wreckage with their hands as survivors climbed over the debris of the bombed-out room.
The bomb exploded about a yard (meter) from journalists covering the event. Associated Press journalist Mohamed Olad Hassan said that people closer to the explosion shielded him from the blast.
In New York, the U.N. Security Council condemned the attack, saying: "This was a criminal attack on people dedicated to building a peaceful, stable and prosperous future for the people of Somalia."
A statement issued by the U.S., European Union, African Union and the Arab League also condemned the attack.
Somalia has been ravaged by violence since warlords overthrew dictator Mohamed Siad Barre in 1991, then turned on each other. A moderate Islamist was elected president in January amid hopes he could unite the country's feuding factions, but the violence has continued.
Suicide bombings, unheard of in Somalia before 2007, have become increasingly frequent and the lawlessness has raised concerns that al-Qaida is trying to gain a foothold in the Horn of Africa. The anarchy also has allowed piracy to flourish off the country's coast.
Source: AP