American man held by the Taliban for more than 2 years has been released from custody, the State Department says.