U.S. President Barack Obama, in a major reversal of strategy, said late Thursday morning that 9,800 U.S. military forces in Afghanistan would stay through the end of 2016. American military presence after that would be drawn back to 5,500 troops to help Afghan security forces to fight the Taliban and ensure that government services and institutions can be built and maintained in the country.

"Afghan forces are still not as strong as they need to be. They're still developing critical capabilities," Obama said during a press conference in the White House's Roosevelt Room. "I will not allow Afghanistan to be used as safe haven for terrorists to attack our nation again."

While the United States is no longer in the valleys and villages in Afghanistan, the Afghan government still needs strategic help from America, the president said. He noted that his administration will not maintain a normal embassy in Afghanistan, either, and will instead keep 5,500 troops at three bases in the country. Those bases are Bagram, Jalalabad and Kandahar.

The announcement is significant for the president's legacy, who ran his 2008 presidential campaign on the promise that he would end the wars in the Middle East that defined his predecessor's presidency. This announcement comes nearly a year and a half after Obama announced in the Rose Garden that U.S. troops would be out of Afghanistan by the end of 2016. Troops will still be in the country when Obama leaves office.

"I do not support the idea of endless war," Obama said in justifying his decision, but added that he is firmly convinced the U.S. should "make extra effort" given what is at stake in Afghanistan.

The issue could become even more salient on the 2016 campaign trail now that Obama has made the decision to keep troops in the country. Republicans have repeatedly attacked the Obama administration for being too weak in the Middle East, while Democrats, including Obama's former Secretary of State, Hillary Clinton, have largely supported his policies.