A large suicide car bombing struck central Kabul, apparently targeting justice ministry employees and killing four people, an Afghan official said.
Shortly after the blast, the Taliban claimed responsibility for the attack.
The bombing took place in the car park of the justice ministry when a car packed with explosives was detonated, said interior ministry spokesman Sediq Sediqqi.
He initially said that at least six people were killed but the interior ministry later revised the death toll, saying four were killed, following an investigation at the site.
"The report from our investigative team confirms that four people were killed, including a woman, and 24 others were wounded," said Mr Sediqqi.
Ministry of public health spokesman 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 4pm bombing coincided with the end of the working day, when ministry employees board minibuses in the car park to go home.
The ministry is surrounded by buildings and shops and is located in one of the busiest areas of central Kabul.
An Associated Press reporter at the scene said windows in buildings in the area had been blown out, indicating a huge explosion.
The justice ministry is close to the mining and finance ministries, as well as the Serena Hotel, which has been targeted in past Taliban attacks, most recently in March last year when nine people were killed there.
An email from the Taliban sent to media organisations in Kabul said the insurgents were behind Tuesday's bombing.
It was the third large attack 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 nine foreigners, and also a suicide car bombing this week that killed three people, among them two young girls and a British security contractor.
The Taliban have also claimed responsibility for a series of recent attacks on judicial employees, including buses carrying workers from the attorney general's office.
The Taliban launched their spring offensive in late April with attacks across a widespread area of the country in what appears to be a fresh strategy aimed at forcing the government to concentrate its efforts and assets on security - rather than on much-needed economic reforms.