“From the beginning of January through mid-November, there was a 27 percent increase in Afghan security force casualties compared with a comparable period last year,” it added.

The Islamic State, also known as ISIS or ISIL, is a new wild card. Western officials initially believed that a breakaway faction of the Taliban in Afghanistan was merely using the Islamic State name, primarily to distinguish itself from other militants. But in recent months, the core group of the Islamic State, which has declared a caliphate in much of Syria and Iraq, delivered several hundred thousand dollars to the Afghan fighters, which has helped them gain ground and recruits.

General Campbell said there were 1,000 to 3,000 fighters in Afghanistan from the Islamic State. Over the past five months, they have begun to coalesce in Nangarhar Province, sometimes clashing with their Taliban rivals. The fighters’ goal, he said, is to move into the city of Jalalabad, expand to neighboring Kunar Province and eventually establish control of a region they call Khorasan, an old name for an area that includes Afghanistan and Pakistan.

“They haven’t kept it any kind of secret,” General Campbell said. The group does not yet have the ability to plan and carry out attacks in Europe or the United States, he added, but “left unchecked, it will.”

As the Islamic State’s strength has grown here, rumors have spread in Afghanistan that the government is secretly supporting the group. At a joint news conference with Mr. Carter, Mr. Stanekzai dismissed the idea as antigovernment propaganda and noted that he had consulted on Friday with local elders to discuss ways to prevent the group from gaining a larger foothold in Nangarhar Province.

Instead of the Afghan government, he said, blame for the Islamic State’s growth rests with the terrorist network that is supporting the militants from “just across the border”: ungoverned areas in Pakistan.