Gen. Mohammad Zahir Azimi, a defense ministry spokesman, said six soldiers and six civilians were killed in the attack. Four of the civilians were children, said Abdullah Fahim, a health ministry spokesman.
The suicide bomber struck a minibus full of soldiers in the Chihulsutoon area south of Kabul, said Aziz Ahmad, an Afghan army officer at the site of the blast.
The minibus was demolished and its mangled frame lay on the side of the road as the wounded were whisked to hospitals.
The blast was third suicide attack in the city in the last eight days. It follows a similar attack against a NATO convoy on Tuesday that left 22 civilians wounded.
Local resident Amir Mohammad said he helped load the bodies of the six slain Afghan soldiers into ambulances.
Mohammad Amin, who runs a bakery close to the blast site, said two of his employees were wounded by flying glass.
"Every day this bus stops in front of my bakery to take employees of defense ministry," Amin said. "Suddenly today a very strong explosion hit the bus," Amin said.
At least 13 civilians were wounded in the attack, according to Fahim, the health ministry spokesman.
Mohammad Ashraf, 13, was praying inside the mosque when the flying shrapnel and glass cut through his flesh, his father Mohammad Akram said.
"My other 8-year-old son was also wounded in the same mosque," Akram said.
Militants have launched more than 133 suicide attacks this year - a record number. At least 6,200 people have died in insurgency-related violence in 2007, also a record, according to an Associated Press tally of figures from Afghan and Western officials.
Suicide attacks frequently target international and Afghan security forces, but most of the casualties are civilian passers-by.
In southern Afghanistan, an explosion struck a patrol of NATO-led troops on Tuesday, killing one soldier and wounding two others, the alliance said in a statement. NATO did not disclose the soldiers' nationalities or the exact location of the attack.