The two car bombs that exploded at Somalia's education ministry next to a busy market intersection killed at least 100 people and wounded 300, President Hassan Sheikh Mohamud said on Sunday, warning the death toll could rise.
Saturday's attack was the deadliest since a truck bomb exploded at the same intersection in October 2017, killing more than 500 people.
The Al Qaeda-linked Islamist group al Shabaab claimed responsibility, saying the ministry was at the centre of a "war on minds" that teaches Somali children using a Christian-based syllabus. Members of the security forces were among the dead and injured, its statement emailed to media said.
Al Shabaab, which is seeking to topple the government and establish its own rule based on an extreme interpretation of Islamic law, frequently stages attacks in Mogadishu and elsewhere.
The first of the explosions hit the education ministry at around 2pm on Saturday. The second hit minutes later as ambulances arrived and people gathered to help the victims.
Mohamed Moalim, who owns a small restaurant near the intersection, said his wife, Fardawsa Mohamed, a mother of six, rushed to the scene after the first explosion to try to help.
"We failed to stop her," he said. "She was killed by the second blast."
President Mohamud said some of the wounded were in a serious condition and the death toll could rise.
"Our people who were massacred... included mothers with their children in their arms, fathers who had medical conditions, students who were sent to study, businessmen who were struggling with the lives of their families," he said after visiting the scene.
The K5 intersection normally teems with people buying and selling everything from food, clothing and water to foreign currency and khat, a mild narcotic leaf. But it was quiet on Sunday, with emergency workers still cleaning blood from the streets and buildings.
Somalia's international partners condemned the attack and sent condolences to affected families.
White House national security adviser Jake Sullivan said in a statement on Sunday the United States "strongly condemns the tragic terrorist attack" and it remains "committed to supporting the Federal Government of Somalia in its fight to prevent such callous terrorist acts."
A spokesman for United Nations secretary-general Antonio Guterres said in a statement that he "strongly condemns these heinous attacks and reiterates that the United Nations stands in solidarity with Somalia against violent extremism."
World Health Organization director-general Tedros Adhanom Ghebreyesus tweeted that his organisation was ready to provide support to the government to care for the injured.
"These senseless attacks against innocent civilians including women and children only serve to remind us of the group's barbarity towards its own people and reveals the true hypocrisy of its intent," the European Union's foreign policy chief, Josep Borrell, said in a statement.
The chairman of the African Union Commission, Moussa Faki Mahamat, urged the international community to "redouble its efforts to ensure robust international support to Somalia's institutions in their struggle to defeat terrorist groups".
With support from the US and allied local militias, the president has launched an offensive against the group, although results have been limited.
Abdullahi Aden said his friend, Ilyas Mohamed Warsame, was killed while travelling in his three-wheeled "tuk tuk" taxi to see relatives before returning to his home in Britain.
"We recognised the number plate of the tuk tuk, which was now rubble," Aden said.
"Exhausted and desperate, we found his body at midnight last night in hospital," he said. "I can't get the image out of my mind."