WASHINGTON -- President Barack Obama announced on May 27 that he would push for a force of 9,800 U.S. troops in Afghanistan after 2014, with the U.S. military commitment fully ending at the end of 2016.

"Starting next year, Afghans will be fully responsible for securing their country. American personnel will be in an advisory role," he said at the Rose Garden. "We will no longer patrol Afghan cities or towns, mountains or valleys -- that is a task for the Afghan people."

The mission for the force will be to train Afghan forces and to conduct counterterrorism missions against Al-Qaeda.

By the end of 2015, troop presence would be reduced to roughly half of 9,800 around Kabul and Bagram Air Force Base. By the end of 2016, the administration hopes to draw down all troops, save for a small presence for the Embassy. A senior administration official said that the size of a NATO presence would be likely determined at the upcoming summit for defense ministers early next month in Brussels.

The troops would only be deployed if the Afghan government signs a Bilateral Security Agreement. The two leading presidential candidates have pledged to sign it if elected, while current President Hamid Karzai has refused to sign a deal.

Obama spoke with Karzai this morning to inform him of the deal along with German Chancellor Angela Merkel, British Prime Minister David Cameron, and Italian Prime Minister Matteo Renzi, according to a senior administration official.

The number of troops -- just under five digits -- is similar to what General Joseph F. Dunford Jr., the commander of U.S. and international troops in Afghanistan, was eyeing, a force of about 10,000 Americans.

While Obama said that 2014 would mark the end of combat operations for the roughly 32,800 U.S. troops in Afghanistan, the plan does call for the U.S. to be in an unpopular conflict for another two full years, or about the end of Obama's second term. Americans overwhelmingly supported intervening in Afghanistan after the 9/11 attacks, but the conflict has grown unpopular as it has turned into the longest war in United States history.

Despite the shift in public opinion, some U.S. lawmakers rushed to criticize the announcement. Republican Sens. John McCain (Arizona), Kelly Ayotte (New Hampshire) and Lindsey Graham (South Carolina) called it a "monumental mistake and a triumph of politics over strategy" that "will make it harder to end the war in Afghanistan responsibly." Sen. Bob Corker (Republican-Tennessee) was more measured, stating that he applauded the announcement but wanted the administration to "revisit conditions" in 2015 and 2016 for a full withdrawal.

Obama said that he did not expect Afghanistan to be a "perfect place" and it was not the U.S. responsibility to make it one.

The announcement came following the president's surprise visit to Afghanistan on May 25, where he visited U.S. troops but not Karzai, who rejected his opportunity to meet with him, although the two two spoke by phone. Obama is also giving a broader foreign policy address on May 28 at the commencement ceremony for the United States Military Academy in West Point, N.Y.

The president acknowledged that ending the war was not easy. "I think Americans have learned that it is harder to end wars than to begin them," said Obama. "Yet this is how wars end in the 21st century."