A US military strike with a weapon known as the “mother of all bombs” (MOAB) killed 36 IS militants and destroyed their base, the Afghan defence ministry says.
The most powerful non-nuclear bomb ever used by the US in combat was dropped on IS tunnels in Nangarhar province.
No civilians were affected by the explosion, the ministry said.
Former Afghan President Hamid Karzai condemned the attack as “an inhuman and most brutal misuse of our country”.
A video released on the US army’s Defense Video and Imagery Distribution System showed footage of the bomb striking its target.
Chief Executive of Afghanistan Abdullah Abdullah confirmed that the attack had been carried out in co-ordination with the government and that “great care had been taken to avoid civilian harm”.
In a press briefing on Friday, Gen John Nicholson, commander of US forces in Afghanistan, said: “We have US forces at the site and we see no evidence of civilian casualties nor have there been reports.”
The Afghan defence ministry said the bomb struck a village area in the Momand valley where IS fighters were using a 300m-long network of caves.
It said the 21,600lb (9,800kg) bomb also destroyed a large stash of weapons.
Presidential spokesman Shah Hussain Murtazawi told the BBC that IS commander Siddiq Yar was among those killed. Mr Murtazawi said the IS fighters in the tunnels had “come from Pakistan and were persecuting people in the local area”.
The GBU-43/B Massive Ordnance Air Blast Bomb was dropped by plane in Achin district on Thursday evening local time, the Pentagon said.
More than 9m (30 ft) in length, it was first tested in 2003 but had not been deployed in combat before.
Gen Nicholson said it was “the right weapon against the right target” and “it was the right time to use the GBU-43 tactically”.
He added: “Let me be clear – we will not relent in our mission to destroy [IS in Afghanistan]… There will be no sanctuary for terrorists in Afghanistan.”
Achin district governor Ismail Shinwary told the BBC that Afghan special forces, with the help of American air support, had begun anti-IS operations in the area 13 days ago.
He said IS targets had been bombed regularly but “last night’s bombarding was very powerful… the biggest I have ever seen”.
Nangarhar Provincial Governor Gulab Mangal said IS fighters had used the complex to “kill people and hold important meetings”.
Massive blast area – Jonathan Marcus, BBC defence correspondent
The clue is in the ungainly name – the MOAB or GBU-43/B massive ordnance air blast is the US military’s most destructive conventional (that is non-nuclear) bomb.
It is a huge weapon and is GPS-guided. It was dropped from a MC-130 aircraft – the US Special Forces variant of the Hercules transport. The weapon is carried on a special cradle inside the aircraft from which it is extracted by a parachute.
Its principal effect is a massive blast over a huge area. It is a larger version of weapons used during the Vietnam War.
The Trump administration’s policy towards Afghanistan remains under consideration but the use of this weapon sends a powerful signal that IS is top of the administration’s target list wherever its offshoots may be found.
A member of an anti-IS group in the area who gave his name only as Mohammad told the BBC he was at a checkpoint 1km from the bomb strike.
He said: “We were eating dinner when we heard a big explosion, [I] came out of my room and saw a mountain of fire… the area was full of light with the fire of the bomb.”
He said all civilians had left the area since the start of the anti-IS operation.
The US has yet to confirm the results of the strike but President Donald Trump called it “another successful job”.
The BBC’s Jill McGivering says it remains unclear what President Trump’s Afghan strategy will be – he has talked in the past about the need for the US to get out of nation-building and may be keen to extricate himself from this long-running and expensive conflict.
But, she says, he has also expressed determination to stop the spread of IS.
Hamid Karzai vehemently condemned the attack, saying on Twitter it was “not the war on terror but the inhuman and most brutal misuse of our country as testing ground for new and dangerous weapons”.
IS announced the establishment of its Khorasan branch – an old name for Afghanistan and surrounding areas – in January 2015. It was the first time that IS had officially spread outside the Arab world.
It was the first major militant group to directly challenge the Afghan Taliban’s dominance over the local insurgency.
However, experts say it has struggled to build a wide political base and the indigenous support it expected. It has steadily lost territory and fighters to US air strikes and an assault by Afghan forces on the ground.
Estimates about IS’s numerical strength inside Afghanistan vary, ranging from several hundred to a few thousand fighters. US forces say their number has been cut in half since early 2016 due to military operations.
The MOAB strike followed last week’s death of a US special forces soldier fighting IS in Nangarhar.
The news also came hours after the Pentagon admitted an air strike in Syria mistakenly killed 18 rebels.
It said a partnered force had mistakenly identified the target location as an IS position, but the strike on 11 April had killed rebels from the Syrian Democratic Forces, which are backed by Washington.