"We can confirm the attack was caused by a suicide bomber on foot. We have received initial reports of a number of civilian casualties and of people trying to reach safe areas outside of the city", said Rik Peeperkorn, acting United Nations humanitarian coordinator for Afghanistan. He says the casualty tolls could rise further.
The fighting has brought civilian life to a standstill, with most residents sheltering indoors.
Two gunmen besieged a compound belonging to the Afghan intelligence service in a northwestern Kabul neighbourhood early Thursday, opening fire as Afghan security forces moved in to cut them off. It is also plagued by roadside bombs planted by insurgents, which are usually intended for government officials or security forces, but often kill and maim civilians.
Another man, who gave his name as Assadullah, told the news agency how he ran toward the blast scene to try and rescue his 17-year-old brother inside.
Taliban officials say they have spoken directly to the top U.S. official on Afghanistan and Pakistan in Qatar, where the Taliban maintains a political office and a delegation traveled to Uzbekistan this month to discuss issues including peace. "Now. I am not sure he will survive".
There were fears for the fate of the other troops from the base, known as Camp Chinaya, as the Taliban claimed dozens had surrendered while others were captured in battle.
In a short message on social media, the Taliban spokesman posted that the group's "mujahideen have no links with Kabul incident".
Both the Taliban and the Islamic State group (ISIS) have carried out devastating, high-profile attacks in Kabul in recent months, but the Taliban quickly denied they were involved.
The explosion, which came as the central city of Ghazni struggles to recover from five days of intense fighting between the Taliban and government forces, underlined how badly security in Afghanistan has degenerated, some two months before parliamentary elections scheduled for October.
The Red Cross said roughly 20 percent of the city's population depends on the municipal water system, which has been down since the start of the fighting.
"There were so many dead bodies under the bridges, at the side of roads and under the destroyed houses", she said.
Although the Taliban overran a base in northern Afghanistan, and Afghan forces were battling insurgents for a fifth day in the eastern city of Ghazni on Tuesday, the US military reported that the city "remains under Afghan government control".
The attack, which came at the end of more than a week of assaults that have left scores of Afghan troops and civilians dead, shows how militants are still able to stage large-scale attacks - even in the capital of Kabul - and undermine efforts by Afghan forces to provide security and stability on their own. There have been signs that diplomatic efforts to kick-start negotiations are bearing fruit.
Afghan volunteers carry an injured youth on a stretcher to a hospital.
Government sources said on Wednesday that over 70 security force members have been killed and dozens more wounded in battles on several fronts around the country including Baghlan, Zabul and Kandahar provinces over the past 24 hours.
The surge in violence comes weeks after Afghans marked an unprecedented country-wide ceasefire between the Taliban and government forces in June, giving some relief to war-weary civilians.