At least 8,400 U.S. troops will remain in Afghanistan through the end of the Obama administration, which will nearly coincide with the conflict’s 15th anniversary.

President Barack Obama announced Wednesday that instead of drawing down U.S. forces in Afghanistan to 5,500 by the end of 2016, around 3,000 more troops will remain in theater to support the Afghan National Security Forces into 2017. It will be up to Obama’s successor to decide the way forward for the U.S military’s longest war from then on.

The troops level is based on recommendations from Army Gen. John Nicholson, commander of U.S. Forces Afghanistan, as well as Secretary of Defense Ash Carter and Chairman of the Joint Chiefs of Staff Marine Gen. Joseph Dunford, Obama said in a July 6 speech.

“The narrow missions assigned to our forces will not change,” Obama said. They remain focused on supporting Afghan forces and going after terrorists.  But maintaining our forces at this specific level — based on our assessment of the security conditions and the strength of Afghan forces — will allow us to continue to provide tailored support to help Afghan forces continue to improve.

Carter said the move was in keeping with the U.S. commitment to supporting Afghanistan’s Unity Government and its security forces as they improve their capabilities and continue taking on the Taliban.

“The troop level adjustment he announced today, which I recommended after consulting with Gen. Nicholson, Gen. Votel and Chairman Dunford, will enhance our ability to continue progress on our two central missions in Afghanistan: strengthening Afghan forces so they can secure their nation and prevent its use as a safe haven for terrorists,” Carter said in a statement. “In consultation with President Ghani, Chief Executive Abdullah and the Afghan government, we and our NATO partners remain determined to help the people of Afghanistan secure a more peaceful future.”

The U.S. military’s combat mission officially ended in December 2014, but the country remains a dangerous place besieged by a resurgent Taliban and terrorists loyal to both ISIS and al Qaida.

Over the past year and a half, 38 Americans — military and civilian — have lost their lives in Afghanistan. Since 2001, 2,200 American troops have given their lives there.

Whereas the U.S. military at its peak had more than 100,000 troops in Afghanistan, fewer than 10,000 are deployed there now, Obama said. They are focused now on two primary missions: training, advising and assisting Afghan security forces and conducting counter-terrorism operations against the remnants of al Qaida and other terrorist groups, including ISIL. 

“In short, even as we’ve maintained a relentless case against those who are threatening us, we are no longer engaged in a major ground war in Afghanistan,” Obama said.

The 8,400 troops that will remain will be assigned to advise the Afghan National Security Forces at the two- and three-star level “out in the field, and doing it on a sustained expeditionary basis,” a senior administration official said in a call with reporters after Obama’s speech. “So it’s a qualitative piece that we wanted to ensure that we could continue through the end of the year.”

Another senior Defense Department official noted that the announcement was made the day before Obama is set to depart for Warsaw and the NATO Summit being held there over the next week. The broader coalition joining U.S. forces in Afghanistan consists of 41 nations providing around 6,000 troops.

“NATO continues to be deeply invested in Afghanistan and its future,” the DoD official said. “We have a number of allies who are themselves committing troops beyond 2016.  We have significant contributions in terms of funding the Afghan security forces from our NATO partners.