Finally a prisoner swap deal has been reached -- widely seen as a victory for Hamas -- on captured Israeli soldier Gilad Shalit, writes Khaled Amayreh in occupied Palestine Having lost all hope of rescuing or securing the release of captured Israeli soldier Gilad Shalit by military means, Israel has finally agreed to accept nearly all Hamas's conditions for a prisoner swap deal that would also see the release from Israeli prisons of over 1,000 Palestinian prisoners, including men, women and children. In an emergency meeting that lasted several hours Tuesday night, the Israeli cabinet approved the prisoner swap deal by a large margin, with only three ministers voting against the deal. The head of the Shin Bet (Israel's domestic security agency) Yoram Cohen Israel was forced to accept the deal, seemingly because there was no other way to bring Shalit home. Earlier, Israeli Prime Minister Binyamin Netanyahu said an agreement with Hamas had been reached and that Shalit would be returning home in the coming days. Speaking during another urgent session of his cabinet, Netanyahu said there was a window of opportunity to release Shalit that he said the government decided to seize. Acting otherwise, he added, and in light of the "storms" blowing throughout the Arab world, could have meant that, "Shalit [would] never come back." Netanyahu was apparently alluding to the Arab Spring and the collapse of pro-Israeli regimes in both Egypt and Tunisia. Hamas officials in the Gaza Strip and abroad have confirmed the conclusion of a swap agreement with Israel. In Damascus, Hamas's leader, Khaled Meshaal, revealed details of the long-awaited deal. He told an impromptu news conference in the Syrian capital that the swap deal stipulated the release of 1,000 male prisoners as well as 27 female prisoners. He also pointed out that the deal would see prisoners with multiple life-imprisonment terms from Jerusalem and the Arab community in Israel released. Meshaal added that the deal would be carried out in two stages, first with the transfer of Shalit outside the Gaza Strip, which would coincide with the release of 450 Palestinian prisoners, and second the release of the rest of the prisoners once Shalit returns to Israel. Meshaal saluted the people of Gaza for their sacrifices and also thanked Egypt, Turkey, Syria and Germany for the positive roles they played in concluding the deal. As of Wednesday, Israeli officials denied that resistance leaders such as Fatah leader Marwan Al-Barghouthi, Ahmed Saadat, secretary-general of the Popular Front for the Liberation of Palestine (PFLP) and Hamas's leading military commander Abdullah Barghouthi, will be part of the release deal. It is unclear if Abbas El-Sayed and Abdel-Salam Abul-Haija will also be excluded. Israel said it would publish soon the names of all prisoners to be released. Abu Ubaida, a resistance Islamist leader in Gaza, told Al-Jazeera TV Tuesday night that the agreement was a landmark victory for Hamas and other Palestinian resistance factions. "This is a great victory for the Palestinian people. We send this gift to the martyrs, including Sheikh Ahmed Yassin." He said that Israel was forced to accede to virtually all the demands and conditions of Hamas. According to the agreement, all women and children prisoners will be freed. A spokesman of the resistance movement in Gaza, Abu Mujahed, attributed the success of the deal to "the resilience and unflinching determination of the resistance to see to it that all our demands are met.�--ê�It was not easy, but eventually we are about to get what we want," he added. Abu Mujahed noted that Palestinian freedom fighters knew that Israel would have to be coerced into the deal. "Israel only understands this language." He also said the deal stipulated that Israel would meet all the demands of Palestinian prisoners in Israeli jails who embarked on an open-ended hunger strike in protest against worsening prison conditions. Egypt, in fact, played a key role in concluding and finalising the deal. An Egyptian official was quoted as saying that "after 64 months of tough negotiations we were able to complete the deal. It was a very difficult task, which included thousands of hours of negotiations." Egyptian officials have also said that the deal reached also includes the release of alleged Israeli spy Ilan Grapel. Coinciding with the deal, another breakthrough on the Israeli-Egyptian side came when Israel's Defence Minister Ehud Barak announced the two countries concluded a joint inquiry into the deaths of six Egyptians killed by Israeli fire on 18 August. Barak went further to express his government's willingness to issue an apology over the deaths. The deaths, which raised tensions between Israel and Cairo, had occurred as Israeli troops chased a number of gunmen responsible for carrying out a series of shooting attacks which killed eight Israelis. During deliberations leading up to the Israeli acceptance of the swap deal, Netanyahu reportedly told his ministers that failing to endorse the deal would probably doom Shalit's fate forever. "If the government fails to approve the deal, the whole move to release Shalit could go down the drain, conceivably postponing his release by many years." Netanyahu spoke of "powerful storms" hovering over the Arab world, which he said would make rescuing Shalit unlikely if the government didn't seize this opportunity. The deal is widely viewed as a great moral and political booster for Hamas. It is also likely to contribute to further enhancing relations between Hamas and Cairo. Moreover, many Palestinians feel the deal will be especially auspicious in terms of pushing forward national reconciliation between Fatah and Hamas. Hamas's fighters, along with fighters from two other smaller groups, the People's Resistance and the Army of Islam, took part in a brief military operation across the border on 25 June 2006, during which Shalit was captured. Israeli officials and media have since used the misleading epithet of "kidnapped" in reference to Shalit, ignoring the fact that he was taken prisoner on the battlefield. Israel tried in vain a number of times to locate Shalit, including during full-scale aggressions against the Gaza Strip in which thousands of Palestinians lost their lives.