(CNN) -- Israel's government approved an extraordinary deal Tuesday night -- agreeing to release more than 1,000 Palestinians from prison, including hundreds serving life sentences for attacks on Israelis, in exchange for a single slender young Israeli soldier, Gilad Shalit.
But the exchange of 1,027 inmates for a single captive does make sense in a Jewish context, Rabbi Arik Ascherman explained Wednesday.
"Judaism places ultimate value on human life. Therefore in the Jewish tradition, in Jewish law, redeeming captives trumps just about everything else," said Ascherman, of Rabbis for Human Rights. "It takes priority over anything else you can possibly do."
Jews around the world greeted the news that Shalit would be released after spending more than a fifth of his life in captivity with overwhelming joy, said William Daroff of the Jewish Federations of North America.
"We have prayed for his release. We have met with his parents, we have sat with his family in their tent outside the prime minister's residence, we have marched for Gilad's release," he said.
"When I announced the news of Gilad's forthcoming release at a reception with Jewish leaders on Capitol Hill this afternoon, it was met by tears, applause, and a spontaneous prayer of thanks," he told CNN late Tuesday.
"Jews across the world have been pining for Gilad Shalit's release for over five years," he added.
Many have left an empty chair in honor of him at their seders, the family meal marking the beginning of Passover, Daroff said.
"We are indeed thankful that Gilad Shalit will soon return to his family and to the Jewish people. It is long overdue," he said.
But the exchange is not without controversy, said Ascherman.
"There has been a very, very difficult debate about this and similar cases over the years," he said.
There is a question in Jewish law about whether it's moral to free a captive in a deal that could potentially endanger other lives -- as many Israelis fear will happen when Palestinians who have killed Israelis are released.
Ascherman sees the benefit of the deal.
"On the one hand, we have somebody who -- if he isn't redeemed -- faces death or danger or captivity, versus a theoretical possibility that someone could be harmed if these people go back to terror," he said.
"I would say it is possible to redeem the prisoner you definitely know," he argued. "But it's certainly a terrible dilemma and Israelis are coming down on both sides."
The spiritual leader of Hezbollah praised Israel for its dedication to repatriating its citizens, dead or alive, during a previous exchange, in 2004.
"We have a fierce enemy in Israel, but I stand here in respect for the enemy that is concerned about his captives and bodies of his soldiers and works diligently day and night addressing those concerns," Sheikh Hassan Nasrallah said as Israel handed over hundreds of prisoners for a kidnapped businessman and three bodies.
"We should acknowledge positives in our enemy when it exists. Whatever their motive is, the fact that they are concerned about their captives, their dead or the bodies of their dead is something to be respected," the Hezbollah leader said.
Rabbi Jonathan Rosenblum is not certain the swap for Shalit is wise.
He too cites Jewish law, or halacha, and says the literature is so vast that there's no clear answer.
"Unfortunately there is an abundance of halachic literature about the redemption of captives," he said.
He cited the example of the 13th-century German Rabbi Meir ben Baruch, known as the Maharam of Rothenburg, who refused to allow the Jewish community to pay a ransom for him when he was held by the Emperor Rudolph.
"He feared that his ransom would encourage any cash-strapped person to grab a hostage. You can't create an incentive for kidnapping," the rabbi said.
"He did not allow the community to redeem him. He died in jail," said Rosenberg, an ultra-Orthodox rabbi and writer. "The idea is that you shouldn't encourage further kidnappings."
The precedent still applies, he argued.
"You see in any Latin American country in which captives are ransomed, it becomes a major criminal activity," he said.
But he, too, circled back to the value Judiasm places on human life.
"However one arrives at the balance in this case, the redemption of captives is a tremendous value," he said.
He said one of Israel's most important rabbis, Shas party spiritual mentor Ovadiah Yosef, had backed the Shalit exchange, and that government ministers must have discussed it with him before it was announced.
"The Shas party would not have voted for it otherwise," he said.
"A friend of mine in the gym the other day asked me why so many government ministers have been going to see Rabbi Yosef," he said. "This has obviously been in the works for some time."
CNN's Paul Colsey, Michael Schwartz and Joe Sterling contributed to this report.