As a father, I rejoice with the parents of Gilad Shalit, the Israeli soldier captured over five years ago by the terrorist organization Hamas and freed recently to return to his country and his family. I’ve been among those who have regularly prayed for his release and periodically visited the tent outside the residence of Israel’s prime minister where his family sat to remind him of his duty to bring Gilad home.

As a Jew, I’m relieved that a fundamental commandment of my tradition to free captives has been observed. Throughout history Jews have paid disproportionate ransoms to liberate their slaves and hostages. The government of Israel has thus come to reflect a lofty principle in Judaism.

As the grandfather of a soldier, currently doing his military service as expected of every Israeli citizen, I’m more fearful than ever. The release of 1,027 Palestinians, many of them guilty of heinous multiple murders, in exchange for Shalit constitutes a twofold danger: it shows that kidnapping for ransom pays handsomely and, second, by freeing notorious criminals it enables them to reoffend.

To leave us in no doubt about it, Hamas officials, their sympathizers and relatives of returning prisoners celebrate what they see as their victory by pledging more kidnappings of Israelis. And the prime minister of Hamas-run Gaza declared that the freeing of the prisoners would soon lead to the capture of Jerusalem and its famous Al-Aksa Mosque.

Such statements don’t inspire confidence. That’s why Israelis are so uncomfortable about the deal even as most support the government on it. The debate is passionate, with persuasive arguments on both sides. However, the conclusion tends to be that, in the end, compassion for Gilad must take precedence.

The principle of the redemption of captives to which the Israeli public yearns to adhere is obviously an Achilles heel and the enemy knows how to exploit it. Perhaps it’s this that had driven some bereaved families to vainly seek a court injunction against the deal by pointing to the implicit breakdown of the justice system as manifest in the release of murderers.

Like many observers, the protesters may not have been persuaded that the decision by the government of Israel was motivated by a commitment to the Jewish teaching that urges us to imitate God by tampering justice with mercy. They probably suspect that it’s crass pragmatism on both sides that has prompted the agreement, which isn’t very different from what was on the table soon after Shalit’s capture, yet delayed until now for reasons of expediency.

On the Hamas side, the weakening of its paymasters Iran and Syria, coupled with the success of its archrival Fatah in the recent Palestinian United Nations bid for statehood, called for a countermove. The deal with Israel presents Hamas in Gaza as a humane and responsible alternative to the Fatah regime on the West Bank.

The prime minister of Israel isn’t unhappy about the rivalry between the two Palestinian sides and, more important, in view of his own low popularity at home he needed to be seen as a benevolent leader who knows how to take tough decisions.

But none of these speculations should detract from the conclusion that, despite all the pitfalls and anticipated backlash, Israel and Hamas did the right thing by making it possible for Shalit to come home. The result has reassured Israelis that, whatever the cost, a captured soldier will never be abandoned. It doesn’t remove fears but it does bring a measure of hope for future mutually beneficial negotiations.

That’s why I’m celebrating with the rest of the Jewish community and its many non-Jewish friends.

Dow Marmur is rabbi emeritus at Toronto's Holy Blossom Temple. His column appears every other week.