PARIS (AP) — Secretary of State John Kerry is defending the release of five Taliban militants from the military prison at Guantanamo Bay in exchange for Sgt. Bowe Bergdahl.

In an interview on CNN's "State of the Union," Kerry says the militants may eventually end up on the battlefield but also could get killed doing that.

When we join the military, we know we take certain risks.

Kerry says he's confident the Gulf state of Qatar will keep a close eye on them for at least a year. And he says the swap was necessary, because: "It would have been offensive and incomprehensible to consciously leave an American behind."

Sen. John McCain says he agrees with Kerry that the U.S. should do all it can to win the release of any American being held. But the Arizona Republican tells CNN such a swap should not be made "at the expense of the lives or well-being of their fellow servicemen and women."

McCain, who was held prisoner during the Vietnam War, says: "when we join the military, we know we take certain risks, and among those risks are wounding, death, imprisonment."