The withdrawal is part of an historic peace deal with the Taliban that aims to end the 18-year war.