Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Thirty feet in length, weighing 21,000 lbs and creating a mushroom cloud seen up to 20 miles away, the "mother of all bombs" was unleashed by the United States in Afghanistan.

It was the largest non-nuclear bomb ever dropped by the U.S. military, so big that instead of being dropped by a conventional bomber it had to be pushed out of a cargo plane while attached to a parachute.

But target of Thursday's strike was not Syria, North Korea or even America's old Afghan enemy, the Taliban — but ISIS.

"Afghanistan was not really on the agenda during Donald Trump's presidential campaign, but ISIS was," explained Emily Winterbotham, a research fellow at the Royal United Services Institute (RUSI), a London-based think tank.

"Clearly Trump has decided that ISIS — whether it is in Iraq, Syria or Afghanistan — is something he is going after," she said.

More than 1,500 miles from their stronghold in Iraq and Syria, militants affiliated with ISIS have been attempting to establish a foothold in the border region between Afghanistan and Pakistan, which for years has been a hotbed for other militant groups.

Their numbers were initially bolstered by defectors from the Afghan Taliban who were disillusioned with their own leadership. They teamed up with jihadis from Pakistan, Chechnya and Uzbekistan to form a group sometimes referred to as ISIS Khorasan Province — or ISIS-K — named after a historical region in the country.

But it has found itself under siege from NATO forces, the Afghan Army and even the Taliban. Although both are enemies of America, the Taliban and ISIS fiercely oppose each other and have been locked in battles as they try to jockey for influence and territory.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Americans are directly involved in this fight. Just last week, Mark R. De Alencar, a staff sergeant in the U.S. Army, was killed while on an anti-ISIS operation in Nangarhar, the eastern province where ISIS is concentrated and where the U.S. carried out Thursday's bombing.

ISIS' Afghan numbers have waned for other reasons. Last year, the Taliban told NBC News that six senior ISIS commanders had left the group because it was simply too violent.

Officials estimate there are currently between 700 and 1,500 ISIS fighters in Afghanistan, small fry compared with the Taliban's 25,000-strong force that controls or is fighting for a third of the country's territory.

Nangarhar is a province in eastern Afghanistan. Google Maps

It is because of conflict with the Taliban — rather than ISIS — that much of the country remains in a chaotic state of conflict. Sixteen years after the U.S. and its allies toppled the Taliban regime, civilian deaths are at record high levels, threatening the gains made during America's longest war.

That's not to say ISIS' Afghan offshoot isn't potent. Over the past two years, it has carried out a series of spectacular attacks on civilians and Afghan security forces. Last month, it claimed responsibility for an assault that saw militants disguise themselves as doctors and kill at least 30 people at a military hospital.

On Thursday, the U.S. carried out its most high-profile attack on the group, dropping the so-called "mother of all bombs," whose real name is the GBU-43/B Massive Ordnance Air Blast bomb, or MOAB.

The cost of each MOAB was listed as $16 million according to website Deagal, which publishes information on military hardware.

However Lt. Col. James Brindle, a Defense Department spokesperson, said later when asked by NBC News that the DoD estimated the cost of each unit to be far lower, around $170,000. This did not include the cost of delivering the weapon.

It was originally designed as a non-nuclear deterrent against Iraqi dictator Saddam Hussein, according to an article published in 2008 by Florida's Eglin Air Force Base.

The GPS-guided bomb struck what the U.S. said was a network of tunnels where ISIS fighters were hunkered down. The aim, according to the military, was to continue the rout of a degraded fighting force.

"As ISIS-K's losses have mounted, they are using IEDs, bunkers and tunnels to thicken their defense," said General John W. Nicholson, commander of America's forces in the country. "This is the right munition to reduce these obstacles and maintain the momentum of our offensive against ISIS-K."

The Afghan Ministry of Defense described the target as "a very important base for ISIS" and said it had been "annihilated." It said three underground tunnels were destroyed, along with weapon and ammunition caches, and 36 ISIS fighters were killed with no loss of civilian life.

The ISIS-affiliated news agency Amaq later denied that any of its fighters had been killed or injured.

The GBU-43/B Massive Ordnance Air Blast bomb in an image provided by Eglin Air Force Base. Eglin Air Force Base via AP

"U.S. Forces took every precaution to avoid civilian casualties with this strike," Nicholson, the U.S. commander, added.

The MOAB was used in this instance because it is effective at targeting people who are hiding in tunnels or caves, according to experts.

"What it does is basically suck out all of the oxygen and lights the air on fire," Bill Roggio, of the Foundation for Defense of Democracies, told the Air Force Times. "It’s a way to get into areas where conventional bombs can’t reach."

Some commentators also wondered whether dropping the MOAB was intended to send a message to North Korea, which is currently in an escalating war of words with the U.S. and its allies.

Asked about this Thursday, President Donald Trump said: "I don't know if this sends a message" to North Korea, before appearing to dismiss the suggestion.

Former Afghan President Hamid Karzai tweeted that he condemned the strike in the "strongest words" — and claimed his country was being used as a "testing ground."