The attack happened in the car park of the Justice Ministry when a car packed with explosives was detonated, said Interior Ministry spokesman Sediq Sediqqi.
He said at least six people were killed and nine were wounded in the explosion.
The spokesman for the Ministry of Public Health, Ismail Kahossi, said a total of 42 people were taken to hospitals around the Afghan capital following the blast. Some sustained only minor injuries from flying glass.
The 4 pm bombing coincided with the end of the working day, when ministry employees board minibuses in the car park to go home.
Also Read
No group immediately claimed responsibility for the bombing.
Today's blast was the third in the capital in the past week.
The Taliban said they were behind an attack on a Kabul guesthouse last week that killed 14 people, including four Indians, and also a suicide car bombing this week that killed three people, among them two young girls and a British security contractor.