Former Afghan President Hamid Karzai has condemned the US military's deployment of the largest non-nuclear bomb ever used in combat, saying Afghanistan should not be used as a "testing ground" for weapons.

The 9,797kg GBU-43 - nicknamed the "mother of all bombs" - was dropped on Thursday from a MC-130 aircraft in Achin district of Nangarhar province, close to the border with Pakistan, according to the Pentagon.

The target was a series of caves and bunkers used by Islamic State of Iraq and the Levant (ISIL). Afghan officials said the massive blast killed at least 36 fighters and destroyed the deep tunnel complex.

US says 'mother of all bombs' hits ISIL in Afghanistan

In a series of Twitter posts, Karzai said: "This is not the war on terror but the inhuman and most brutal misuse of our country as testing ground for new and dangerous weapons."

"It is upon us Afghans to stop the USA," he said.

I vehemently and in strongest words condemn the dropping of the latest weapon, the largest non-nuclear #bomb, on Afghanistan by US...1/2 — Hamid Karzai (@KarzaiH) April 13, 2017

2/2 military. This is not the war on terror but the inhuman and most brutal misuse of our country as testing ground for new and dangerous... — Hamid Karzai (@KarzaiH) April 13, 2017

2/3 weapons. It is upon us,Afghans, to stop the #USA. — Hamid Karzai (@KarzaiH) April 13, 2017

A current Afghan official also denounced the bombing.

"I find the use of the largest non-nuclear bomb, the so called 'mother of all bombs', on our soil reprehensible & counterproductive," Omar Zakhilwal, the Afghan envoy to Pakistan, also said on Twitter.

"If big bombs were the solution, we would be the most secure place on earth today."

Afghan President Ashraf Ghani's office said in a statement the US attack was a part of a joint operation by Afghan and international troops.

"Afghan and foreign troops closely coordinated this operation and were extra cautious to avoid any civilian casualties," it said.

US President Donald Trump called Thursday's operation a "very, very successful mission".

Towering flames

The ultra-heavy explosive is equal to 11 tonnes of TNT with a blast radius of 1.6km.

At a village 5km from the remote, mountainous area where the bomb was dropped, witnesses said the ground shook from shockwaves, but homes and shops appeared unaffected.

"Last night's bomb was really huge. When it dropped, everywhere, it was shaking," resident Palstar Khan told Reuters news agency, adding he believed no civilians were in the area hit.

He praised the strike, saying killing ISIL fighters was a "positive move".

READ MORE: On the front line of Afghanistan's battle with ISIL

"The explosion was the biggest I have ever seen. Towering flames engulfed the area," local governor Esmail Shinwari told AFP news agency.

Inamullah Meyakhil, spokesman for a hospital in eastern Nangarhar, said the facility had received no dead or wounded from the attack.

ISIL denied it suffered any casualties. "Security source to Amaq agency denies any dead or wounded from yesterday's American strike in Nangarhar using a GBU-43/B," the group's self-styled news agency said on social media accounts. ISIL rarely admits losses after such attacks.

The Taliban, meanwhile, condemned the bombing.

"Using this massive bomb cannot be justified and will leave a material and psychological impact on our people," the armed group said in a statement.

'Right time, right target'

General John Nicholson, head of US and international forces in Afghanistan, said the "weapon achieved its intended purpose".

Nicholson said the decision to use the bomb was based on his assessment of military needs and not broader political considerations.

"This was the first time that we encountered an extensive obstacle to our progress," he said of a joint Afghan-US operation that has targeted ISIL since March. "It was the right time to use it tactically against the right target on the battlefield."

The GBU-43 had never been used in combat since its first test in 2003.

READ MORE: Dear Donald Trump - Letters from Afghanistan

General Daulat Waziri, spokesman for the Afghanistan Ministry of Defense, said the death toll of ISIL fighters could rise. He said the bombing was necessary because the fortification was extremely hard to penetrate, with tunnels as deep as 40 metres.

"It was a strong position and four times we had operations [attacking the site] and it was not possible to advance," he said, adding the road leading to the cave complex "was full of mines."

Estimates of ISIL's strength in Afghanistan vary.

US officials have said they believe the group has only 700 fighters, but Afghan officials estimate there are closer to 1,500 in the country.

Mark Kimmitt, a retired brigadier-general in the US army and former deputy assistant secretary of defense, played down the use of the GBU-43, saying it is "just another tool the military has".