It may be a sign of just how far the Mideast has wandered off the U.S. script that the biggest breakthrough in Israeli-Palestinian negotiations in years looks likely to be a prisoner exchange between Israel and Hamas. Although no deal has yet been sealed, officials from both sides say that indirect talks via German mediators are close to yielding an agreement that would free 22-year-old Sergeant Gilad Shalit in exchange for the release of about 1,000 Palestinians held in Israeli prisons.Among those on the Hamas list is Fatah leader Marwan Barghouti, convicted on charges of murder and terrorism but also his movement's frontrunner to replace the hapless President Mahmoud Abbas who appears to be signaling an end to his own tenure. In a prison interview published in an Italian newspaper on Wednesday, Barghouti signaled his intention to unify Fatah and Hamas and to run for president. He also argued that the abduction of Shalit had forced Israel to make concessions that no negotiations had ever achieved — a message not welcomed by either Abbas or his U.S. backers.Freeing Shalit has been a national obsession for a country where military service is compulsory, ever since his capture, as a 19-year-old corporal, on the Israeli side of the Gaza border in 2006. The longer his captivity has dragged on, the more the pressure has grown on the Israeli government from across the political spectrum to do more to secure his release, in keeping with a longstanding Israeli philosophy of leaving no soldier, alive or dead, on the battlefield.Successive governments have prioritized Shalit's release, but have been unwilling to meet Hamas' price, which Israeli security officials have warned would encourage further abductions. Israeli security officials also told TIME that a prisoner swap would be a major political blow to President Abbas, giving his rivals in Hamas a victory on the politically powerful issue of freeing Palestinian prisoners. The security men have pressed their government to soften the blow by making concessions on settlements or other issues raised by Abbas. On Wednesday, Prime Minister Benjamin Netanyahu announced a ten-month pause in building in West Bank settlements. But Netanyahu's insistence that Israel will continue build in East Jerusalem — a policy viewed as a provocation throughout the Arab world — means his offer is unlikely to help Abbas much.Still, both sides now appear to have reason to conclude a deal on Shalit. Hamas leaders are mindful of the potential political damage they could suffer in the next election if Gazans blame the movement's defiance for the suffering inflicted by Israel's economic blockade and last winter's military offensive that killed more than 1,200 Palestinians. They need a demonstrable victory for their "steadfastness".Israel's leaders appear to have reached consensus on the need to close a painful chapter of Israel's history, even if the cost is steep — the freeing of hundreds of militants serving time for planning attacks against Israelis. And as Barghouti's statements confirm, their release will be seen by Palestinians as vindicating the aggressive tactics of Hamas.While the negotiations remained cloaked in secrecy, in background conversations with TIME and in other leaks to the media, officials from both sides have indicated that a resolution to the saga is near. Still, significant issues remain unresolved, such as the final list of Palestinian prisoners to be freed; whether they'll be released into the Palestinian territories or into exile; and whether or not Israel will lift its blockade of Gaza (which it has previously refused to do before Shalit is freed). Hamas is also internally divided over a prisoner swap, with the political leadership more eager to deliver a victory that could reclaim lost ground in Gaza, while the military wing is less open to compromise.One bone of contention concerns prisoners on Hamas' list that hold Israeli citizenship, who Israelis feel have no right to evade Israeli justice and whose release would strengthen support for Hamas among Israeli Arabs. Even more controversial is the fate of some 10 prisoners who are either senior militant leaders or have been convicted of grave crimes. Foremost among these is Barghouti, former West Bank secretary general of Fatah, who since 2004 has been serving five life sentences. Barghouti represents a powerful and growing movement in Fatah that is ready to close the book on the failed "peace process" and to return to the path of combining negotiations with "resistance" — a combination of armed, non-violent and diplomatic measures to raise pressure on Israel.Barghouti's popularity is such that he is widely tipped as a successor to Abbas at the head of Fatah, and he has signaled his intention to run for president of the Palestinian Authority. Hamas has been pushing for the release of Barghouti, a longtime advocate of unity between Hamas and Fatah, in contrast to Abbas and other leaders of the organization who are engaged in an ongoing power struggle against the Islamists. Barghouti's family and some Fatah officials have said his name is on Hamas' list of prisoners to be released, but both the U.S. and Israel has been pushing against it.Despite political and security concerns, the leaders of Israel's government appear to have agreed on doing a deal, and polls suggest that a large majority of Israelis would support it. The joy of freeing their captive soldier will be tempered, however, by the spectacle of Palestinians celebrating the return of men with Israeli blood on their hands.Israel's Shalit dilemma underscores a growing concern that prioritizing the safety of the individual soldier may put the wider society at risk. A government-appointed committee, header by former Supreme Court Justice Meir Shamgar, is already formulating guidelines proposing limits on future prisoner swaps, in effect asking Israelis to begin a painful conversation over just how much security risk each Israeli life is worth.With reporting by Rami Aysha in Beirut, Aaron J. Klein in Tel Aviv and Jamil Hamad in Bethlehem