The attack follows a threat by the Taliban to target foreign forces in the spring offensive that it launched last week.
At least 30 people were killed and dozens wounded by ISIS militants in a recent attack on a Kabul hospital– the latest in a series of attacks on civilians.
Gunmen dressed as medics stormed the hospital, battling security forces for hours, in an attack claimed by ISIS.
A witness saw one gunman, dressed in a white doctor’s coat, take out a concealed AK-47 and open fire, killing at least one patient and one hospital worker.
The bomber appeared to have entered an area where guards were performing security checks when he detonated the explosives.
Over 30 people were killed and dozens were wounded in the attack in the Afghan capital that targeted the Shi’ite community.
President Ghani announced a day of mourning, but many members of the Hazara community blame the government’s apathy for the attack.
“Two fighters from Islamic State detonated explosive belts at a gathering of Shi’ites in the city of Kabul in Afghanistan,” said a brief statement on the group’s Amaq news agency.
The casualties appeared to include both Afghans and Nepalese security contractors.
Taliban spokesman Zabihullah Mujahid said the attack on staff from the judicial system was in response to the Afghan government’s decision earlier this month to execute six Taliban prisoners on death row.