Critics of the decision to swap Taliban captive Sgt. Bowe Bergdahl for five Taliban commanders held at Guantanamo Bay accuse President Obama and his officials of violating the long-standing U.S. policy of never negotiating with terrorists. The administration insists that the policy is intact.

The critics are missing the point. On balance, the exchange made sense. It isn't just that a U.S. soldier has been recovered at little net cost to U.S. security interests: The release is part of a broader effort to serve those interests. The administration has long been trying to engage with the Taliban as the U.S. war effort winds down, and rightly so.

It isn't an easy policy to set before the American public, but it's a necessary one. If the U.S. exit from Afghanistan is not to end in disaster for the people of that country, there must be some kind of accommodation between their government and the Taliban. By releasing the five Taliban commanders, the administration hoped not just to get Bergdahl back, but also to move that larger process along.

To be sure, the five Taliban are still enemies of the United States. They're bad men: Two of them have been implicated in massacres of Shiites, for instance. Also, it's an awkward complication that some of Bergdahl's fellow soldiers apparently suspect him of desertion — hardly the ideal case for ensuring "no man is left behind." Nonetheless, since the Taliban isn't going to be crushed, it will have to be talked to. Scruples about good and bad negotiating partners must yield to that reality.

Republican claims that the swap will encourage terrorists to kidnap Americans are unconvincing. Fighters on the battlefield need no additional incentive to kill or capture the enemy. There's little prospect of this swap serving as a model for hostage taking in other situations.

To drive home that point, the administration is right to insist that no precedent is being set. It helps that it hasn't designated the Afghan Taliban as a terrorist group. The Taliban sheltered Osama bin Laden and Al-Qaida but has not itself attacked U.S. targets outside the theater of war. According to their Defense Department dossiers, all five Taliban were captured and held for their roles in fighting coalition forces.

The timing of the swap is admittedly questionable. Prisoner exchanges generally come when hostilities have ceased. The five Taliban were released to Qatar, which agreed to ensure they would not pose a threat to the United States and banned them from traveling for a year, but that isn't reassuring. There's a chance the men will take up arms again, as others released from Gitmo have done.

However, with the U.S. preparing to withdraw, other considerations loomed larger. The opportunity to strike a deal for Bergdahl's release was closing; his health was a growing concern, and widening a channel of communication with the Taliban was good policy. The deal was no great cause for jubilation, but it would have been a mistake not to strike it.