At least 35 people were killed when a suicide bomber riding a motorcycle blew himself up at a bank in eastern Afghanistan.
President Ashraf Ghani said the blast was claimed by the Islamic State group.
The attack marks a major escalation in the country’s fight against an affiliate of the extremist group that now holds a third of Iraq and Syria in its self-declared caliphate.
It also comes as Afghan security forces fight against the Taliban after US and Nato forces ended their combat mission in the country at the start of the year, yet another challenge for the war-ravaged nation.
The attack in Jalalabad, the capital of eastern Nangarhar province, targeted a crowd of soldiers and civilians gathered outside the bank to receive their monthly salaries.
The blast killed at least 35 people and wounded 125, said Ahmad Zia Abdulzai, a spokesman for the provincial governor.
Hours after the attack, President Ghani blamed Islamic State (IS) for the bombing.
“In the horrific incident in Nangarhar, who took responsibility? The Taliban didn’t claim responsibility. Daesh claimed responsibility for it,” he said, using an Arabic acronym for the group.
The Taliban denied it carried out the attack and another elsewhere in the province which killed one civilian and wounded two.
“We condemn/deny involvement in both,” Taliban spokesman Zabiullah Mujahid tweeted.
Mr Ghani has warned before that IS was starting to establish a presence in Afghanistan. He used his visit to the United States last month to reiterate his concerns that the extremist group was making inroads into Afghanistan.
“If we don’t stand on the same line united, these people are going to destroy us,” he told 600 people gathered at the provincial government headquarters in Faizabad, the capital of north-eastern Badakhshan province.
He called on the Taliban to join with the Kabul government, and said that any Taliban who switched allegiance to IS would earn the wrath of Afghanistan’s religious leaders.
Mr Ghani also blamed a recent attack on an army outpost, in which 18 soldiers were killed, eight of them beheaded, on “international terrorists”. The Taliban are not known to carry out beheadings.
United Nations Assistant Secretary-General for Human Rights Ivan Simonovic, on a visit to Afghanistan, called the attack a “war crime”.
“The use of suicide bombs and other devices in such an indiscriminate way by insurgent groups clearly constitutes a war crime, and those responsible for organising or perpetrating such attacks must be brought to justice,” he said in a statement.
Disenchanted extremists from the Taliban and other organisations, impressed by IS’s territorial gains and slick online propaganda, have begun raising its black flag in extremist-dominated areas of both Afghanistan and neighbouring Pakistan.
Analysts and officials say the number of IS supporters in the Afghan-Pakistan region remains small and that the group faces resistance from militants with strong tribal links. Taliban fighters and Islamic State supporters have even battled each other.
However, the rise of even a small Islamic State affiliate could further destabilize the region and complicate US and Nato efforts to end the 13-year Afghan war.
Taliban militants in Afghanistan and Pakistan owe their allegiance to Mullah Omar, a cleric who has led the Taliban since the 1990s but has not been seen or heard in public for years.
Officials fear that an IS push into the region could bring an infusion of guns and money, sparking brutal competition among local militants disenchanted with Mullah Omar’s silence and eager to prove themselves with escalating atrocities.
In recent days, Ismail Khan, long a dominant figure in Afghanistan’s western province of Herat, told the Associated Press that the numbers of IS supporters are growing because of divisions in Mr Ghani’s government.
Afghanistan’s senior Shiite leader, Mohammad Mohaqiq, told the AP this month that IS loyalists in southern Zabul province also were behind the abduction of 31 ethnic Hazara Shiites in late February.