NAIROBI, Kenya — At least six people were killed, including two children, after a suicide bomber detonated an explosives-laden vehicle outside a district headquarters in Somalia's capital, Mogadishu, authorities said Sunday. Capt. Mohamed Hussein said the bomber tried to speed through a checkpoint but was stopped by security forces, prompting him to detonate the vehicle near the gate of Howlwadag district headquarters.

The three soldiers who stopped the truck were killed instantly and the three others killed were civilians, said the Mogadishu mayor's spokesman, Salah Hassan Omar.

Fourteen people, including six children, need intensive care, said the Aamin Ambulance service. Among the wounded was deputy district commissioner Ibrah Hassan Matan.

Get Breaking News Delivered to Your Inbox

Many victims were students at a nearby Islamic school. Officials warned there could be more casualties as the blast brought down nearby buildings including a mosque.

"I saw bodies strewn on the ground after the explosion before the ambulances and the paramedics reached the scene and the whole scene was very ugly," witness Halima Mohamed said.

The attacker "literally failed to achieve their goal of inflicting maximum casualties," police captain Hussein said, accusing the al-Qaida-linked extremist group al-Shabab of carrying out the attack.

Somalis search for bodies amidst wreckage at the scene of a blast outside the compound of a district headquarters in the capital Mogadishu, Somalia, on Sun., Sept. 2, 2018. AP

Al-Shabab later claimed responsibility for the explosion, which shattered a period of calm in seaside Mogadishu. The Somalia-based al-Shabab often targets the capital with bombings, including a truck bombing in October that left at least 512 people dead.

Somali troops are meant to take over the Horn of Africa nation's security in the coming years from an African Union force but concerns about their readiness remain high. The U.N. Security Council recently voted to delay the reduction of troops in the AU force from October to February and the target date to hand over security to Somali forces to December 2021.