There has been no official claim of responsibility for the blast but the man, who was detained by Somali security forces as he tried to drive a second vehicle packed with explosives into the city on Saturday, has given details of the plot to interrogators.
“This is the Somali 9/11. The man we arrested has confessed. He is proud of what he has done. He says it was for jihad,” one official said.
Analysts said the Somali security services had been under “very great pressure” in recent months, and had been seriously weakened by internal factional fighting.
“We are on the track of those responsible and will bring them to justice,” the official said.
A second security official said explosives had been hidden under rice, sugar and other goods on the truck, which passed though a government-controlled checkpoint at Sinka Dheer, about four miles (7km) outside Mogadishu.
Suspicious officers stopped the vehicle and briefly detained its driver. It is understood a local businessman and tribal leader vouched for the truck.
One focus of the ongoing investigation is whether the extremists had help from within the security forces, the official said.
The bombing provoked international condemnation. Lights on the Eiffel Tower would be turned off in memory of the victims, Paris town hall announced.
The US mission to Somalia said: “Such cowardly attacks reinvigorate the commitment of the United States to assist our Somali and African Union partners to combat the scourge of terrorism.”
The scale of the attack is still becoming clear, as more victims continue to be dug from the rubble spread over an area hundreds of metres wide in the centre of the city.
Witnesses described an area the size of “two or three football fields” where buildings had been razed.
Though details are still emerging, it is thought the truck bomb was aimed at one of the ministries in the area but was detonated prematurely by its driver when it was stopped by security officials while stuck in a traffic jam. The explosion then ignited a fuel tanker parked nearby.
Abdikadir Abdirahman, the director of Amin ambulances, said 320 people died in the blast and appealed for overseas assistance.
“Families whose family members are missing are calling me every single minute,” Abdirahman said. “At such a time we need international organisations … they are good at [dealing with] crises like this.”
Sirens were heard throughout Monday morning as ambulances ferried injured people from hospitals to an airlift organised by the Turkish government, which has established a major diplomatic and humanitarian presence in Somalia in recent years.
Rescue workers said it was difficult to count casualties because the intense heat generated by the blast meant the remains of many people would not be found. Others may have been buried quickly by relatives following Islamic custom.
“One hundred and sixty of the bodies could not be recognised and so they were buried by the government [on Sunday],” Aden Nur, a doctor at the city’s Madina hospital, said. “The others were buried by their relatives. Over a hundred injured were also brought here.”
The president, Mohamed Abdullahi Mohamed, declared three days of national mourning and joined thousands of people who responded to a plea by hospitals to donate blood for the wounded.
Mohamed, who took power in February, had vowed to rid the country of al-Shabaab. He has faced huge challenges, with the insurgency proving resilient to the ramped-up offensive aided by the US, and a famine.
Al-Shabaab, which has been affiliated to al-Qaida since 2011, has a history of launching bomb attacks against civilian targets.
“Al-Shabaab do not care about civilian deaths,” said Rasheed Abdi, an expert in Somalia with the International Crisis Group in Nairobi. “They see a population that is close to the government and think the more of them they can kill the better.”
Investigators will seek to establish the source of the military-grade explosives that are thought to have been used in the attack. One source suggested they had been stolen from Amisom, the much-criticised African Union peacekeeping mission, which has about 20,000 troops in the country.
Though largely confined to the countryside since withdrawing from Mogadishu six years ago, al-Shabaab has repeatedly taken over small towns, as well as inflicting significant losses on Amisom and Somali troops.
Abdi said al-Shabaab’s recent capture of Bariire, a town about 30 miles from Mogadishu, was important as its loss exposed the southern flank of the city.
The US military has increased drone strikes and other efforts this year against al-Shabaab, and a US special forces operative was killed in a skirmish with the group earlier this year, the first American combat casualty in Africa since the Black Hawk episode in Mogadishu in 1993.
More about: #Mogadishu