Sustained U.S. and Afghan operations combating the Afghanistan branch of the Islamic State has led to a near-collapse of the jihadist group in eastern Afghanistan — helping clear a hurdle for an American withdrawal from the country.

President Donald Trump touted success of recent operations against the Islamic extremist group during a Thanksgiving Day surprise visit to American troops at Bagram Airfield detailing that U.S. forces were “wiping” out ISIS militants “left and right.”

“There’s almost nothing left in this area. And al-Qaida, the same thing. And tremendous progress,” Trump told U.S. troops during the visit. “And we — we’ve got them down to very low numbers. We’ll have that totally taken care of in a very short period of time.”

The New York Times, citing a Western official, reported that the number of ISIS militants had dwindled down to roughly 300 from previous estimates that claimed the group was fielding several thousand fighters.

A recent UN report said ISIS terrorists in Afghanistan numbered between 2,500 and 4,000 fighters. A 2019 DoD report on Afghanistan estimates the size of the terrorist group to be less than 2,000 fighters.

Zalmay Khalilzad, Trump’s envoy leading peace negotiations with the Taliban, credited U.S. and Afghan operations against ISIS, but also Taliban efforts to defeat the group.

“The recent campaign in Nangarhar is one example. Effective operations by US/Coalition & Afghan security forces, as well as the Taliban, led to ISIS-K losing territory & fighters. Hundreds surrendered. ISIS-K hasn’t been eliminated but this is real progress,” Khalilzad tweeted Tuesday.

Afghan President Ashraf Ghani, who met Trump at Bagram and spoke to U.S. and Afghan troops during Thanksgiving, said that Afghan and American troops had “inflicted an incredible defeat on ISIS in Nangarhar.”

National security experts and critics of a U.S. draw down if Afghanistan oft warn of the plethora of terror groups operating in Afghanistan as a reason to maintain as U.S. presence in the region.

Fears of an ISIS resurgence in Afghanistan has become a major hurdle for U.S. troops seeking to withdraw from the region after nearly 18 years of war.

“We’re doing a tremendous job. And, as you know, a big part of that job is ISIS — certainly the biggest — and al Qaida,” Trump told U.S. troops at Bagram.

A recent Defense Department inspector general report noted that despite U.S. efforts to seek a negotiated settlement with the Taliban, terrorists groups in the country will still remain a threat.

The DoD said that the U.S. will need to maintain a “robust” counterterrorism capacity for the “foreseeable future,” in Afghanistan, according to the IG report.

Analysts and military officials routinely cite that Afghanistan is a hotbed for nearly 20 terrorist groups.

A former U.S. defense official told Military Times that the size of any counterterroism footprint that remains in Afghanistan will depend on what groups the U.S. and Afghan government consider a threat.

The Coalition conducted a series of airstrikes to support Afghan Commandos clearance of ISIS-K fighters and fighting positions in Pekha Valley, Achin district, Nangarhar province, Afghanistan, Feb. 17, 2018. Persistent offensive ground and air operations throughout the winter expelled ISIS-K from more than seven kilometers of mountainous terrain in southeastern Nangarhar. (Spc. Jacob Krone/Army)
The Coalition conducted a series of airstrikes to support Afghan Commandos clearance of ISIS-K fighters and fighting positions in Pekha Valley, Achin district, Nangarhar province, Afghanistan, Feb. 17, 2018. Persistent offensive ground and air operations throughout the winter expelled ISIS-K from more than seven kilometers of mountainous terrain in southeastern Nangarhar. (Spc. Jacob Krone/Army)

“Its almost certainly going to include the Islamic State, but I don’t know of the Haqqanis will fall into the category. Probably not, if there’s a real peace,” the former defense official said.

The Haqqani network is an affiliate of the Taliban and was designated a terrorist group by the U.S. State Department in 2012.

“If there’s a limited target list, eg only IS, then the presence might be small and geographically dedicated in the east of the country,” the former defense official explained.

Trump told U.S. troops at Bagram that negotiations that peace negotiations with the Taliban were back on. Trump canceled the negotiations in September after a deadly bombing by the Taliban claimed the life of a U.S. service member.

“The Taliban wants to make a deal. We’ll see if they want to make a deal. It’s got to be a real deal, but we’ll see,” Trump said. “And they only want to make a deal because you’re doing a great job. That’s the only reason they want to make a deal."

The U.S. is amid one of its most intensive bombing campaigns targeting Taliban militants. There are currently 13,000 U.S. troops in Afghanistan.

According to a Reuter’s story, Secretary of Defense Mark Esper said that a U.S. draw down of forces in Afghanistan was “not necessarily” linked to a peace deal with the Taliban.