Gen. John F. Campbell, commander of U.S. and NATO forces in Afghanistan, listens to journalists during a news conference Saturday in Kabul. (Omar Sobhani/Pool photo via AP)

Gen. John. F. Campbell, commander of coalition forces in Afghanistan, arrived here 18 months ago expecting to be the U.S. military leader who would bring the war to a close. On Saturday, as he prepares to hand-off command to his successor, Campbell was instead promising that coalition forces “are here to stay.”

“Not only the U.S., but the whole international community, are now starting to talk about long-term commitment,” Campbell told reporters at what was billed as his last news conference before Army Lt. Gen. John W. “Mick” Nicholson Jr. takes over command of coalition forces in early March. “It ought to give confidence to the Afghan people and also send a message to the Taliban too: What they thought in 2015 — everyone is leaving, and they could wait us out, that is no longer the case here.”

Campbell’s remarks reflect just how much the Obama administration’s posture toward Afghanistan has changed over the past two years.

When Campbell began his tour in August 2014, Obama had already announced plans to reduce U.S. troop levels in Afghanistan to 9,800 by the start of last year. The president then hoped to cut that number in half by the start of this year, paving the way for him to fulfill his 2008 campaign promise of withdrawing all U.S. troops before he leaves office in January.

But with the Taliban insurgency showing little sign of weakening and the Islamic State attempting to gain a foothold here, Obama abandoned those plans last year.

Obama is now keeping 9,800 U.S. troops in Afghanistan through the end of this year. Administration officials say Obama still plans to cut that number in half before his presidency ends, but many analysts believe he may leave that decision up to the next administration.

For now, however, the scope of U.S. military involvement in Afghanistan is once again broadening.

Obama gave Campbell, who also oversees U.S. counterterrorism efforts in Afghanistan, new authority last month to aggressively target Islamic State militants near the Afghanistan-Pakistan border through airstrikes and Special Forces operations.

Campbell said that authority was needed because the Islamic State hopes to use Afghanistan to plan and coordinate attacks on Europe and the United States. The Pentagon estimates there are only 1,000 to 3,000 Islamic State fighters in Afghanistan, but Campbell warned “they have the ability to recruit quite well, not only around the world, but inside Afghanistan.”

“How much is coming from Syria and Iraq? Hard to tell,” Campbell said. “But we do believe the senior leadership here in Afghanistan does communicate with [Islamic State leader Abu Bakr al-Baghdadi] in Iraq and Syria.”

But Campbell said coalition forces’ biggest task over the next year will be the mission to train the Afghan army for its continued battle against the Taliban.

Despite more than $35 billion in U.S. support over the past 15 years, the Afghan army struggled to repel a major Taliban offensive this past fall into Kunduz, a commercial hub in northern Afghanistan, taking days to regain control. The Taliban also made gains in several eastern and southern provinces last year.

To prepare for another “tough year,” Campbell said the coalition is sending several hundred additional advisers to Afghanistan’s volatile Helmand province, where some of the bloodiest battles of the 14-year war have been waged.

On Saturday morning, Taliban insurgents packed explosives into several stolen Afghan army Humvees and attacked Afghan forces in Helmand’s Sangin district, according to Campbell and local officials.

U.S. military officials say the challenge facing the Afghan army is compounded by still being 25,000 soldiers short of its targeted strength of 195,000. Recruitment is especially poor in Pashtun communities in Helmand and Kandahar provinces, raising concerns about a potentially destabilizing geographic imbalance within the military, officials said.

Campbell, who plans to retire after nearly 37 years in the army, declined to say whether his job in Afghanistan would have been easier if he had more troops. He also declined to speak about what recommendations he plans to give Nicholson, except to say that he would not be “bashful.”

Despite recent setbacks, however, Campbell remains optimistic the Afghan military will eventually bring stability to the country.

“The Taliban . . . are not 10-feet tall,” Campbell said. “They can be beaten.”

Read more:

Pentagon will boost number of U.S. military advisers in southern Afghanistan

Campbell: A strategic stalemate without end is not the goal of this campaign

A $43 million gas station in Afghanistan? Not so fast

The U.S. was supposed to leave Afghanistan by 2017. Now it might take decades.