Officials agreed to swap him and another man for a Taliban member serving a life sentence in the U.S. for drug and terrorism charges.