FOB FENTY, Afghanistan — Islamic State militants are gaining a foothold in Afghanistan's Nangarhar Province, stoking concern among U.S. military leaders and fundamentally changing the nature of the insurgency here, top defense officials said.

Defense Secretary Ash Carter on Friday made an unannounced visit to this remote base, one of the primary U.S. military outposts in eastern Afghanistan and one of the few slated to remain open indefinitely in this war-torn nation.

Carter came to talk with some of the 500 U.S. troops deployed here and to meet with senior military leaders for an up-close update on the mission during the wintertime fighting lull. It was one of his last stops on a week-long trip across the U.S. Central Command area of operations, where he is talking to commanders on the ground about progress in the fight against the Islamic State group.

Carter warned that Afghanistan faces many extremist and insurgent threats that include the Taliban, the remnants of al-Qaida, and most recently the Islamic State group, also known as ISIS, ISIL or D'aesh.

"They are trying to create little nests wherever they feel there is an opportunity," Carter said of ISIS. "We have some information that suggests they seem to find an opportunity here in Nangarhar. That is really good information to have because it will allow us to focus our efforts on what they are doing in Nangarhar and make sure they don't have a nest here."

It was Carter's first visit to Afghanistan since President Obama announced in October that the U.S. military mission in Afghanistan will extend beyond 2017 and some bases outside Kabul will remain operational under American control — FOB Fenty among them.

Army Gen. John Campbell, the top U.S. commander in Afghanistan, estimates there are between 1,000 and 3,000 ISIS ISIL fighters across Afghanistan.

"Over the last five or six months, it's kind of coalesced here in Nangarhar and Kunar.  For the most part they are trying … to build from Jalalabad. They want to go into Kunar, they want to establish this as a base," Campbell told reporters Friday.

There's scant evidence of ISIS foreign fighters in Afghanistan, and many experts believe the group's recruits in Afghanistan are local insurgents who previously operated with other local extremist groups and have simply changed their allegiance to ISIS.

But one key difference is money. The Taliban continues to get funding and inspiration from a leadership organization in Pakistan, while the ISIS group is getting money from other sources, presumably connected to its base in Iraq and Syria, a senior defense official said.

It remains unclear whether any substantial command-and-control relationship exists between Afghanistan's ISIS adherents and the leaders of the group's strongholds in Iraq and Syria.

ISIS "doesn't have the capability, I believe, to go to Europe and attack or go to the homeland. Left unchecked, it will. They've said they want to do that," Campbell said.

The emergent ISIS militants are in competition with the longstanding Taliban insurgency. Clashes between ISIS and the Taliban are common as the two fight for territory, influence and power. The emergence of ISIS here has fundamentally altered the battlefield.

"What we are seeing actually as the distinguishing feature of ISIL in Nangarhar is that it is one the Taliban is quite threatened by and is diverting a lot of its own resources to trying to challenge," the senior defense official said.

"This ISIL dynamic, it is a new dynamic in this insurgency," the official said. "Given the volatility that we've seen emerge from its use of social media and its recruitment elsewhere, I think it's really important to stay on top of and monitor and deter any kind of threat that could emerge from what is a relatively nascent element in the overall insurgency."

The Taliban remains the Afghanistan government's primary threat. For about a week this fall, the Taliban seized control of the city of Kunduz, its biggest battlefield victory since 2001.

The Afghan army quickly mounted a counterassault and, with the help of U.S. airstrikes and special operations troops, regained control of the city's center.

Campbell also said al-Qaida remains a threat. In October, Afghan special forces troops raided a large al-Qaida training camp in a remote region near Kandahar and killed 150 to 200 al-Qaida fighters.

Afghanistan's defense minister, Mohammed Masoom Stanekzai, came to FOB Fenty to meet with Carter and downplayed the threat from ISIS.

"The problem is not as big as it is portrayed. But the propaganda will have an impact on the morale of the people," Stanekzai said.

Campbell agreed that ISIS's new presence has fueled a lot of chatter and conspiracy theories.

"There is a lot of propaganda and information operations that people have been putting out there.  In fact there's been a member of parliament that said national government was supporting D'aesh — and that's just silly," Campbell said.