Carter's visit comes as his top commander there, Gen John Campbell, voiced concerns that foreign fighters from Syria and Iraq are joining with Afghans who have declared loyalty to IS in the east, near the Pakistan border.
Officials have been warning for some time that while the presence of IS has been small, it is attracting disaffected members of the Taliban. Campbell in an Associated Press interview said supporters of IS are trying to establish a regional base in Jalalabad.
Carter is on a weeklong visit to the region, and spent the last two days in Iraq.
Carter flew immediately from Bagram Air Field to Operating Base Fenty in Jalalabad, where he was met by Campbell.
Also Read
There are about 600 US troops at Fenty, one of the key bases where American troops will remain beyond 2016. Other bases have been shut down across the country as the number of US and coalition forces has dropped in recent years.
In October, at the urgings of his military commanders, President Barack Obama announced that he would keep troops levels steady through most of next year. By the end of 2016, rather than draw down to a Kabul-only US military presence of about 1,000 troops as previously planned, Obama decided the US will maintain 5,500 troops in Kabul and Bagram.
The latest report on violence in the country said Obama's decision reflects the need to give Afghans more time to develop a credible army.
According to a senior defence official, elements of the Taliban in eastern Afghanistan feel threatened by the Islamic State's growth there and it has created a new dynamic in the region. And the Taliban are resources to try to challenge IS.