Witnesses said a large convoy carrying troops from African Union Mission in Somalia (Amisom) the AU force fighting the militants, was passing through the area when the bomb went off.
Al-Shabaab controlled the capital until 2011 when it was pushed out by Amisom troops, but it still holds territory in the countryside and launches frequent attacks against government and civilian targets in Mogadishu and elsewhere.
Eight people were killed and over a dozen injured in a car bombing near a school in Somalia's capital Mogadishu on Thursday, police said, in the latest attack claimed by Al-Shabaab jihadists in the troubled country.
"Eight civilians were killed and 17 others wounded in the blast," Abdifatah Adan, a spokesman for Somalia's police, said in a brief statement, without giving further details.
Security official Mohamed Abdillahi told AFP earlier that the blast was caused by a car bomb that left 11 students injured.
"We don't know the target of the attack," he said.
Al-Shabaab claimed responsibility for the bombing, saying it was aimed at "military trainers".
Witnesses said a large convoy carrying troops from African Union Mission in Somalia (Amisom) the AU force fighting the militants, was passing through the area when the bomb went off.
"I was close to the area when the blast occurred; there was an Amisom convoy... passing by," Said Ibrahim told AFP.
Witnesses said the bomb caused heavy damage to the school and vehicles parked nearby.
"The school building was badly damaged and some of their school buses destroyed,"Â Ahmed Bare, a security guard at a nearby building, told AFP.
The director of Mogadishu's Aamin ambulance service, Abdikadir Abdirahman, shared photos of the rubble-strewn scene on Twitter, calling the bombing "a tragedy".
Al-Qaeda linked militants, Al-Shabaab, regularly carry out attacks in the capital and elsewhere in the country, most recently targeting a prominent Somali journalist who was killed in a bombing on Saturday. Abdiaziz Mohamud Guled, the director of government-owned Radio Mogadishu, was a fierce critic of the Islamists.
Al-Shabaab, which has been waging a violent insurgency against the country's fragile government since 2007, said its fighters had long pursued the journalist.
The militants also claimed two attacks in September that together killed 17 people.
A car bombing on September 25 near the presidential palace killed eight people, including the prime minister's adviser for women and human rights, Hibaq Abukar.
Eleven days earlier, nine people, most of them members of Somalia's security forces, died in a blast near a Mogadishu checkpoint.
Al-Shabaab controlled the capital until 2011 when it was pushed out by Amisom troops, but it still holds territory in the countryside and launches frequent attacks against government and civilian targets in Mogadishu and elsewhere. Â