The Taliban denied involvement in the attack, and there was no immediate claim of responsibility. Islamic State extremists have in the past targeted Shiite Muslim Hazaras, who they consider apostates.
Jawad Ghawari, a senior Shiite cleric, blamed the ISIS. There have been at least 13 attacks on the Shiite community in Kabul alone, he said.
The bloodshed in Kabul capped off a grim few days throughout Afghanistan.
Also on Wednesday in eastern Laghman province, six girls gathering firewood were killed when they found an unexploded rocket shell, according to a local official.
A spokesman for the governor of Laghman, Sarhadi Zwak, said the victims were aged between 10 and 12. He blamed insurgents rockets for the deaths.
And in northern Baghlan province, a late Tuesday Taliban assault killed 30 soldiers and police at two checkpoints.
The violence underlined how an emboldened Taliban — which was ousted by American forces after the Sept. 11, 2001, attacks on the U.S. — has been pressing its advantage throughout the country. A much smaller group of ISIS-linked fighters continue to target civilians, security forces and often the Taliban.
The number of civilians killed in Afghanistan reached a record in the first half of the year, according to the United Nations, amid a surge in ISIS-claimed suicide attacks.
Since Friday, Afghan forces backed by American airstrikes fought to oust militants who had overrun the strategically important city of Ghazni south of Kabul.
The United Nations warned that days of fighting in Ghazni may have caused an “immense” casualty toll among government forces, militants and civilians.
“Unconfirmed estimates range from 110 to 150 civilian casualties” in Ghazni, Secretary-General’s Special Representative for Afghanistan and head of the U.N. Assistance Mission in Afghanistan Tadamichi Yamamoto said in a statement.
“Reliable information indicates that the Ghazni Public Hospital is overwhelmed by a continuous influx of injured government forces, Taliban fighters and civilians,” the statement added.
In June, an unprecedented ceasefire marking the end of the Ramadan fasting season was brokenby a car bomb that struck a gathering of Taliban and Afghan security officials, killing at least 20.
Ahmed Mengli reported from Kabul; F. Brinley Bruton reported from London.
Read on EuroNews