Barack Obama actually said...
Maintaining these forces in Afghanistan would be for the purposes of training, advising, and assisting Afghan forces and supporting counterterrorism operations against the remnants of al-Qa'ida.
Context
Letter to Congressional Leaders on the Global Deployments of United States Combat-Equipped Armed Forces
06/11/2014