Palestinians and some Israelis are celebrating an agreement to free more than 1,000 Palestinians and a young Israeli soldier in the coming days. The deal comes after five years of hard negotiations between the Israeli government and the Palestinian militant group Hamas. Sealing the deal was in the interests of the various parties.
The announcement of the prisoner exchange deal Tuesday night brought celebrations in Israel and the Gaza Strip, which Hamas controls.
Negotiations for the exchange had stalled repeatedly and as a result, the announcement came as a surprise to many.
The head of Israel's Institute for Counter-Terrorism, Boaz Ganor, says the agreement was finally reached, because it serves the current interests of Israel and Hamas as well as Egypt, which brokered the deal.
"This exchange was signed as an outcome of a unique window of opportunity in which the interests of all the relevant actors have more benefit in concluding this crisis than sustaining it," said Ganor.
He says the accord helps Hamas' goals of gaining international legitimacy. Hamas, which took control of Gaza four years ago, has been isolated diplomatically because it refuses to recognize Israel and backs an armed struggle against it.
Some analysts say a factor in the prisoner release deal could be a bid by Hamas to counter the rising popularity of rival Palestinian leader Mahmoud Abbas after he requested United Nations' recognition of a Palestinian state last month.
The head of Jerusalem's Palestinian Academic Society, Mahdi Abdul Hadi, says Hamas also is trying to improve relations with Egypt, which has imposed travel and trade restrictions along its border with Gaza.
Abdul Hadi says Hamas may be looking for a new location for its Syria-based leaders as the Syrian government comes under increasing Arab criticism for its violent crackdown on a seven-month-old popular uprising.
"Hamas is looking for a way out of Damascus," said Hadi. "And Egypt might be, could be the address for a future Hamas, hosting their leadership."
Analysts say the deal also serves the interests of Israeli Prime Minister Benjamin Netanyahu who has been under pressure to obtain the release of Israeli soldier Gilad Shalit since he was captured, at the age of 19 years, by Hamas five years ago.
They say freedom for Shalit would likely boost the prime minister's popularity, which has been sagging in recent months. And they say it would serve to undermine Abbas after his U.N. recognition bid, which is strongly opposed by Israel.
Israel also is worried that upcoming elections in Egypt might bring into power a government that would be less favorable to mediating a prisoner exchange.
The Israeli government is keen to improve ties with Egypt. Those ties have been strained since August when five Egyptian soldiers were killed in crossfire at the border as Israeli troops pursued Palestinian militants who mounted an attack in Israel from Egypt's Sinai.
Following the border incident, a mob attacked the Israeli embassy in Cairo, leading to the evacuation of its staff. The Israeli government announced Tuesday it would apologize for the border shooting and compensate the victims' families.
Abdul Hadi says the Egyptian government also stands to benefit from its diplomacy. It is under increasing public pressure to enact democratic reforms from leaders of the popular uprising that ousted President Hosni Mubarak earlier this year.
"The new Egypt is interested in achieving a success on the Palestinian front for many reasons inside Egypt and in the region as well; in terms of security, in terms of movement of people, in terms of Gaza, in terms of Sinai," added Hadi.
Ganor says the popular uprisings across the Arab world have brought tension and uncertainty to many veteran leaders in the region.
"We are now in a fragile time in the region," Ganor noted. "There is an ongoing threat of another uprising that might happen as an outcome of the Arab spring and it is an outcome of youngsters, Palestinian youngsters."
Analysts say given the turmoil in the region, the times seemed to provide a window of opportunity for agreement on the prisoner exchange, a window that many feared might soon be closed.