At least 31 people have been killed and 54 others are wounded after a suicide bomber struck a voter registration centre in the Afghan capital Kabul.
Islamic State claimed responsibility for Sunday's blast, the militant group's AMAQ news agency reported.
General Daud Amin, the Kabul police chief, said the suicide bomber targeted civilians who had gathered to receive national identification cards.
The large explosion echoed across the city, shattering windows kilometres away from the attack site and damaging several nearby vehicles.
Police blocked all roads to the blast site, with only ambulances allowed in. Local TV stations broadcast live footage of hundreds of distraught people gathered at nearby hospitals seeking word about loved ones.
Afghanistan will hold parliamentary elections in October.
Last week, three police officers responsible for guarding voter registration centres in two Afghan provinces were killed by militants, according to authorities.
Elsewhere in Afghanistan, a district police chief in the northern Balkh province died of his wounds after being shot Saturday during a gunbattle with insurgents, according to Sher Jan Durrani, spokesman for the provincial police chief in Balkh. He said around a dozen insurgents were also killed in the battle, which is still underway.
Durrani identified the slain commander as Halim Khanjar, police chief for the Char Bolak district.
The Taliban claimed responsibility for the killing.