ISIS has claimed responsibility for a suicide bomb attack in Kabul on Sunday that killed at least 52 people and wounded more than 100.
The incident took place outside a voter registration center in the Afghan capital in the most serious attack yet on preparations for elections scheduled for October.
The attack is also seen as targeting a project of key importance to the credibility of President Ashraf Ghani's government, which has been under international pressure to ensure long-delayed parliamentary polls take place this year.
Interior Ministry spokesman Najib Danesh said a bomber on foot approached the center where officials were issuing identity cards as part of the registration process for around 10 million voters across Afghanistan. Registration began this month.
President Ghani issued a statement condemning the attack and said it "cannot divert us from our aims or weaken this national democratic process."
The explosion destroyed cars and shattered windows in nearby buildings, leaving rubble strewn across the blood-stained street.
It was the deadliest blast in Kabul since about 100 people were killed in January by a bomb concealed in an ambulance and it came after repeated warnings that militants could try to disrupt the election process.
Tadamichi Yamamoto, the senior United Nations official in Afghanistan issued a statement condemning the attack.
"Compounding the callous disregard for the lives of civilians, the killing appears to be part of a wholly unacceptable effort by extremists to deter Afghan citizens from carrying out their constitutional right to take part in elections," he said.
After weeks of relative calm, the blast took place in Dasht-e Barchi, an area of western Kabul inhabited by many members of the mainly Shi'ite Hazara minority, which has been repeatedly hit by attacks claimed by ISIS.
"There were women, children. Everyone had come to get their identity cards," said Bashir Ahmad who had been near the blast, which occurred despite heightened security after the January attack.
According to UN figures, more than 750 people have been killed or maimed in suicide attacks and bombings by militant groups during the three months to March ahead of an expected start of the Taliban's normal spring offensive.
Afghanistan's international partners have insisted that the elections should be held this year before a presidential vote due in 2019, although there has been widespread skepticism that they will go ahead.
More than 7,000 voter registration centers have been set up across Afghanistan to handle about 10 million registrations.
Officials had pledged tight security to ensure the process proceeded safely. But those caught by Sunday's attack voiced frustration at what many Kabul residents see as government shortcomings in securing the capital.
"They should be keeping the country safe, if they can't, someone else should be in their place," said Sajeda, who was wounded in the blast along with three other members of her family as they lined up for their cards.
The voter registration process, designed to reduce the electoral fraud that has marred past ballots, began this month but there have already been several attacks.
On Sunday, a roadside bomb near a registration center in the northern city of Pul-i Khumri killed six members of a family and wounded three, although there was no indication that the incident was directly linked to the Kabul attack.
Last week, two police officers in the eastern city of Jalalabad were killed outside a voter registration center, while a voter center in the central province of Ghor was burned down last week and electoral officials briefly abducted.
The vote could be postponed to next year if registration of voters, many of whom do not have national identity cards, is not completed before winter sets.
Parliament is still sitting three years after its term officially expired and further delays would seriously weaken already fragile confidence in the political system.
There was an additional scare on Sunday when a NATO military convoy in Kabul accidentally hit and injured a child and triggered a protest that police dispersed by firing into the air. A NATO spokesman said the child had been taken to hospital and was in a stable condition.
By Qadir Sediqi and Sayed Hassib/Reuters
Additional reporting by Abdul Aziz Ibrahimi, Sardar Razmal in Kunduz, Ahmad Tolba in Cairo; writing by James Mackenzie; Editing by Robert Birsel.