This Sunday will mark 25 years since Israel Air Force navigator Ron Arad was taken captive, never to return. Prime Minister Benjamin Netanyahu's effort to conclude a deal for the return of Gilad Shalit, was meant to ensure that the kidnapped soldier would not share Arad's fate. Barring any last-minute hitches, it seems Shalit will be home in a few days, after more than five years in captivity.

There have been many previous reports predicting that a deal would soon be signed, especially in the Arab press. But this time, there is good reason for optimism - mainly, the fact that both sides now seem serious about signing a deal whose outlines have been known for years: Israel will release some 450 Palestinians convicted of serious crimes in two stages, the first when Hamas transfers Shalit to Egypt and the second upon his return home. Some time later, Israel will free another 550 or so, to be billed as a gesture to Cairo. Hamas dictated the identity of the first 450; the remainder are at Israel's discretion.

What do you think about the Shalit deal? Visit Haaretz.com on Facebook and share your views.

A deal has seemed near twice before - in March 2009, at the end of Prime Minister Ehud Olmert's term, and in December that year, after Netanyahu had taken office - but the gaps proved unbridgeable. Initial details of the current deal indicate that both sides gave a little more: Israel reduced the number of prisoners it wants sent to Gaza or abroad, rather than to their West Bank homes, while Hamas gave up on freeing certain senior terrorists it previously insisted on - though it isn't yet clear precisely whom.

Netanyahu came to Tuesday night's meeting confident the deal would be approved. Repeated polls have shown the public overwhelmingly supports a deal, even if it involves freeing murderers, and last night's excited television broadcasts about the impending exchange also provided a tailwind. Few ministers could withstand this pressure.

Senior defense officials support the deal as well. Israel Defense Forces Chief of Staff Benny Gantz came to the meeting to declare that Israel must bring its soldiers home, even if the price is heavy. Former Shin Bet security service chief Yuval Diskin, who opposed the deal, left office in May, and his successor, Yoram Cohen, apparently deemed the new Hamas concessions sufficient to make it acceptable.

Cohen matters, because it will now become his problem: Even with some terrorists being deported, hundreds more will return to the West Bank, and the Shin Bet is tasked with keeping them from resuming attacks. Granted, the Palestinian Authority also has an interest in doing so. But the experience of all previous such deals has been that a sizable portion of the freed terrorists will resume terrorist activity - and many of them will have acquired new knowledge from fellow prisoners during their stay in Israeli jails.

This time, Israel's starting point is good: The Shin Bet and the IDF have been systematically destroying West Bank terror cells for years. But no one can guarantee that the newly freed prisoners won't foment new attacks in the coming years.

The deal is certain to improve Netanyahu's standing with the public. His spokesmen will credit him with softening Hamas' stance; last night, they also leaked reports that fears for Shalit's health had made the exchange urgent.

Hamas' lifesaving compromise

Time after time senior Egyptian officials have said that the gap between the sides negotiating for Shalit's release is narrowing. However, they also repeatedly emphasized the need for brave, historical decisions on both sides. Indeed it seems the willingness of the Israeli government and Hamas to show flexibility paved the way for the deal to be sealed.

But no matter how much joy the Shalit family – and all Israelis – will feel, it's hard to overlook the price of this deal. Details of the deal are still not entirely clear, but nevertheless, the thousands of Hamas supporters who celebrated in Gaza last night had good reason to do so. That said, the "accomplishment" – as Khaled Meshal, the head of Hamas' political bureau, coined the deal in his speech Monday – was far from meeting the initial demands of the organization. In light of its difficult political standing, it seems Hamas was forced to compromise and give up on many of its demands. One such compromise was that they agreed to the expulsion of 203 prisoners from the Gaza Strip.

On the one hand, Hamas' standing in the territories will be bolstered dramatically as a result of the deal in the coming days. The boost PA President Mahmoud Abbas received from opting to seek UN recognition of a Palestinian state despite Washington's opposition will be completely overshadowed by the political capital Hamas is likely to reap from this deal. Whereas Abbas' gains were purely symbolic, Hamas will be able to lead the celebrations over 1,027 returning prisoners. Never before has Israel paid so high a price for a single soldier. The families of returning prisoners will be photographed in all forms of Arabic media, and Hamas will hold huge processions to mark its victory.

On the other hand, Hamas is likely to also cop criticism for what appears to be a major compromise on its behalf: the expulsion of 203 released prisoners from the Gaza Strip and the continued imprisonment of many senior prisoners. Hamas must have been pushed into a corner to have agreed to such a dramatic compromise.

But still, this deal represents political salvation for Hamas, whose support in recent months has been waning in both Gaza and the West Bank. Conditions in Gaza, which it rules, are poor and show little sign of improving, while Abbas' UN bid had made Hamas almost irrelevant to political developments. The prisoner release will change all that dramatically. It will pull Hamas out of the deep political pit that it had fallen down.

The other big winner is Egypt. Where both German and Turkish mediators failed to conclude a deal, Egyptian intelligence officers – under the leadership of Murad Muwafi and his deputy who managed the negotiations Mohammed Ibrahim – succeeded. Egypt's new leadership has thus proven it can still affect dramatic change in the Middle East. But it's doubtful that says anything about its ability to do the same inside Egypt.

If the deal does in fact materialize, the German and Egyptian negotiators, along with the Israeli government's special envoys to the negotiations Ofer Dekel and Hagai Hadas and their substitute David Meidan, deserve a good word. Meidan, a senior Mossad official until recently, made tremendous efforts over the past months to reach an agreement. That effort was accompanied by a new approach and creative thinking, which appeared Tuesday night to have finally produced results.