President Trump warned of consequences of a hasty withdrawal from Afghanistan in 2017.