The blast happened at around 6:40 a.m. Monday (10:10 p.m. ET Sunday) when a Toyota Corolla exploded in the city's west, Afghan Interior Ministry spokesman Najib Danish told CNN.
It is the latest in a string of attacks in recent days by the Taliban, which said it had captured two districts in northern and central Afghanistan at the weekend.
In a statement released by Taliban spokesman Zabiullah Mujahid, the group said the Kabul bomb's target was a bus carrying Afghan intelligence staff, but Danish said that all the victims were civilians, including some employees of the Ministry of Mining and Petroleum. Women and children were among the dozens injured, Danish said.
Saleem Rasooli, head of Kabul hospitals, put the death toll at 29 and said at least 40 others were injured in the blast.
A witness told CNN he saw injured people in the streets and others yelling in the bombing's aftermath.
"In the morning I was sleeping when I heard a loud boom, which woke me up," said 33-year-old Safiullah, who gave only his first name.
He looked out of a window in his home and saw plumes of smoke rising from the site as people ran in a panic.
Afghanistan's Chief Executive Abdullah Abdullah and President Ashraf Ghani both condemned the attack.
"I strongly condemn the terrorist attack on civil servants in Kabul today," Abdullah said in a tweet.
"Our security institutes will hold perpetrators accountable."
Ghani's office said in statement: "The enemy of Afghanistan can't face our forces in battle field so they target innocent civilians."
UN Secretary-General Antonio Guterres condemned the attack, saying "the deliberate targeting of civilians constitutes a grave violation of human rights and international humanitarian law and may constitute a war crime."
The uptick in violence comes as President Donald Trump mulls sending more US troops to Afghanistan, amid no signs that the Taliban is weakening.
There are about 8,400 US troops in the country at the moment. The US counterterrorism mission there, which also fights ISIS, is separate from a NATO-led effort to train, advise and assist the Afghan army and police force to fight the Taliban.
More than 1,600 civilians were killed in Afghanistan in the first half of the year, UN figures show
, a record high in the 16-year war.