Six months before Shalit was abducted, Gershon Baskin was at a conference in Cairo, where he struck up a friendship with a professor at the Islamic University of Gaza, a member of Hamas, who put Gershon in contact with Ghazi Hamad, Hamas’s deputy foreign minister, and it was this relationship, that ultimately led to the Shalit deal.

Gilad Shalit's military ID from 2005. Credit Michal Chelbin and Oded Plotnizki for The New York Times

Gilad Shalit’s military ID from 2005. Credit Michal Chelbin and Oded Plotnizki for The New York Times

On the afternoon of June 27, 1976, Palestinian and German terrorists hijacked an Air France flight originating from Israel and directed it eventually to Entebbe Airport in Uganda, where most of the non-Israelis on board were immediately released. More than 100 hostages remained, 83 of whom were Israeli. They were held for the next six days, until an elite team of Israel Defense Force commandos freed them in the famous raid known as Operation Entebbe. The name of the mission became synonymous with Israel’s refusal to give in to the demands of terrorists and its willingness to go to extraordinary lengths, and risk many lives, to free Israeli hostages.

Despite Prime Minister Yitzhak Rabin’s final decision to use a military operation to rescue the Entebbe hostages, recently declassified documents tell a more complex story, one that reveals Rabin’s doubts about the mission and exposes the inescapable dilemma, which has only intensified over the years, at the heart of Israel’s policy toward its own captured citizens. We now know that even as the raid was being planned, the Rabin government was making contact with various international middlemen to obtain a list of the hijackers’ demands, and Rabin himself privately said he was willing to release the 53 prisoners the terrorists had named. During the secret discussions prior to the Entebbe operation, Rabin, who agreed to the mission after much persuasion by intelligence and ministry planners, effectively established the principle that is still followed by all Israeli leaders facing hostage situations: if the necessary intelligence is available and the operational circumstances allow, force — even a great deal of it — will be used to free hostages; if not, Israel will negotiate a prisoner exchange.

Israel is still adding up the cost of winning the release last month of Gilad Shalit, shown here in one of the life-size cutouts that proliferated by the thousands throughout the country. Credit Michal Chelbin and Oded Plotnizki for The New York Times

Israel is still adding up the cost of winning the release last month of Gilad Shalit, shown here in one of the life-size cutouts that proliferated by the thousands throughout the country. Credit Michal Chelbin and Oded Plotnizki for The New York Times

Rabin signed off on the Entebbe plan only after intelligence agents assured him that aerial surveillance showed Ugandan soldiers guarding the terminal where the hostages were being held, indicating that the building was not booby-trapped. (These same documents also reveal the orders to follow if the commandos ran into Idi Amin himself. “He isn’t a factor,” Rabin said. “If he interferes, the orders are to kill him.” To which the foreign minister, Yigal Allon, added, “Also if he doesn’t interfere.”)

Amos Eiran, who was then director general of Rabin’s office, told me recently: “On the morning of the operation, Rabin summoned me and went over the wording of the resolution he was going to propose to the cabinet on the subject of the operation. He was wearing a dressing gown and was very tense. He accompanied me to the elevator and said: ‘Prepare for me a draft letter of resignation. I give the operation a 50-50 chance. If it fails, I’ll accept all the responsibility and resign.’ I asked, ‘What will you see as a failure?’ and he replied, ‘Twenty-five or more dead.’ ” When the mission was completed, three passengers and one Israeli soldier were killed.

Thirty-five years later, many who took part in Operation Entebbe at the highest levels were also involved in the negotiations to bring home Gilad Shalit, the Israeli soldier who was abducted by Palestinian commandos on June 25, 2006, and whose capture has consumed Israeli society for the last five years. Shimon Peres, then Israel’s defense minister and now its president, signed the pardons for the Palestinian prisoners who were released in exchange for Shalit. Ehud Barak, a planner of the Entebbe raid, is today Israel’s defense minister. Tamir Pardo, who is currently the chief of Israel’s intelligence agency, the Mossad — and whose support helped Prime Minister Benjamin Netanyahu push the Shalit deal past skeptics in his administration — was the communications officer for the commander who led the raid in Entebbe. That commander, Yonatan Netanyahu, was the only Israeli military casualty of the operation, struck by a bullet while advancing with his men toward the terminal where the hostages were held. In the command bunker in Tel Aviv, when Peres learned that Yonatan Netanyahu had been killed, he told those present that Israel had lost “one of most wonderful people there has ever been in this country.”

It was at the antiterrorism foundation established by the Netanyahu family in honor of Yonatan’s memory that his younger brother Benjamin began his career. In 1986 he edited a book titled “Terrorism: How the West Can Win,” which argued intensely against negotiating with terrorists under any circumstance. In one of the two articles he contributed to the book, Netanyahu wrote: “This is a policy that in effect tells the terrorists that we will not give in to your demands. We insist that you free the hostages. If you do not do so peaceably, we are ready to use force. We are offering a simple exchange: your life for the lives of the hostages. In other words, the only ‘deal’ we are prepared to do with you is this: If you surrender without a fight, you will stay alive.”

Today, when explaining how he, of all leaders, could sign the agreement that marked a new record of acquiescence to a terrorist organization — the release of 1,027 prisoners, many of them with Israeli “blood on their hands” — Netanyahu falls back on the policy that was laid down by Rabin in the deliberations leading up to Entebbe: the intelligence and the operational circumstances left him no alternative but to make a deal.

“We had no choice,” a source close to Netanyahu told me after Gilad Shalit returned home. “There were innumerable other possibilities for exerting pressure which resulted in nothing. Bibi would have been happy to try and rescue Shalit in a military operation, if that would have been possible, but the intelligence community could not locate him. In the end, the question was whether to leave Gilad rotting in a pit in the Hamas prison or to take a bold decision. That’s what Bibi did.”

Gilad Shalit’s parents, Aviva and Noam. Credit Michal Chelbin and Oded Plotnizki for The New York Times

Gilad Shalit’s parents, Aviva and Noam. Credit Michal Chelbin and Oded Plotnizki for The New York Times

Gilad Shalit grew up with his parents, Aviva and Noam, and his brother and sister in a small community in western Galilee, not far from the Lebanese border. At school, Gilad loved math and sports, and he possessed an encyclopedic knowledge of the American N.B.A. He joined the army in 2005 as a teenager and, despite a marginal health classification, was accepted into a combat unit that was dispatched in the spring of 2006 to protect the Israeli communities along the border of the Gaza Strip.

On June 25 of that year, Gilad, then 19, was one of the crew of a Merkava tank deployed near the border fence at the southern end of the strip. A squad of eight Palestinian commandos burrowed beneath the fence and split into three groups when they emerged, targeting an observation tower, an empty armored personnel carrier that the Israelis had placed as a decoy and the tank in which Shalit was stationed. They crept silently forward, eventually taking the Israelis by surprise. One of them fired a rocket that hit the tank and wounded its commander, and in the firefight that followed, two Israelis were killed. Shalit and one other soldier at the tank were wounded. The other wounded soldier caught a blurred glimpse of Shalit being dragged away by the Palestinians, who escaped back through the border fence, on which Shalit’s flak jacket was later found hanging.

Within days, Israel launched a series of heavy bombardments on Gaza, code named Operation Summer Rains, destroying the power station and cutting off electricity to tens of thousands of people there. Dozens of Hamas officials were arrested, and Israeli troops shut down the borders in order to search Gazan neighborhoods for Shalit. Hamas responded with volleys of rockets fired at Israeli settlements, to which the Israelis retaliated with even more bombardments.

According to the Israeli human rights organization B’Tselem, in the fighting that continued until a cease-fire was reached on Nov. 26, 2006, 416 Palestinians were killed (5 Israelis were also killed, one by friendly fire). The cease-fire endured on and off until late 2008, when clashes broke out between Hamas and the I.D.F. along the Gaza border. Israel then launched Operation Cast Lead, an extensive invasion of the Gaza Strip that resulted in 1,390 Palestinian deaths, 700 of whom were Hamas, 454 of whom were women and children. This was followed by yet another cease-fire, one that appears to be disintegrating now, in the wake of Shalit’s release.

The Gaza Strip, where Shalit was held, is very small and densely populated and is surrounded almost entirely by Israeli ground and naval forces. Gaza itself is subject to constant aerial surveillance by drones and is rife with informers and collaborators with Israel. Finding Shalit became a top priority for Israel’s intelligence agencies, which soon received information on the precise location at which he was being held: a fenced private residence on the outskirts of Gaza City. Planning for a rescue operation was under way when Israeli intelligence learned that Hamas, in cooperation with Iranian intelligence, had planted false information in order to lure Israelis into raiding the booby-trapped house. The operation was called off, and Shalit’s location was never established. It is very unlikely that we will ever learn where he was held. The degree to which Gaza, unlike the West Bank, is opaque to Israeli intelligence has profound implications for future operations there. The inability of Israeli intelligence to discover Shalit’s place of captivity in a small space that is an hour’s drive from Tel Aviv was a profound failure, one to which the departing heads of Israel’s three security organizations — Mossad, Shin Bet and the military — all admitted when they retired this year.

On July 12, two and a half weeks after their son’s capture, Noam and Aviva Shalit met with Prime Minister Ehud Olmert, who told them that he had information indicating that Gilad was alive and well. The parents asked if he had precise information on where their son was being held.

“We are doing everything to find him,” Olmert replied, “but I am sorry to say that so far we have no solid, unequivocal information.” The Shalits implored Olmert not to stage a military rescue operation that would endanger the life of their son and the lives of other soldiers, even if the necessary intelligence was obtained.

As Olmert was explaining to them that he was not prepared under any circumstances to enter into negotiations with Hamas, his top military aide handed him a message saying that two more Israeli soldiers had been abducted, this time by the extremist Shiite militia Hezbollah, on the Lebanese border. (Olmert denies discussing the possibility of a military rescue with the Shalits or his negotiating stance with Hamas.)

Olmert ordered a full-scale war to free the two soldiers and to show Hezbollah that, as the common Israeli expression goes, “the boss has gone crazy” — that Israel would respond disproportionately to abductions. The Lebanon war lasted a month and became a humiliation for Israel, failing to cause significant long-term military or political damage to Hezbollah and failing, too, to recover the missing soldiers.

Three weeks after the two men were seized, the Israeli Defense Forces produced a report saying that one of them had been killed and the other received grievous wounds and was in all likelihood dead, but withheld this report from the prime minister for reasons not clear to this day. It is speculated that it was either neglect or the desire from elements in the higher ranks not to provide Olmert a reason to stop the operation. In a strange circumstance, I happened to be the one who informed Olmert’s staff of the report, when I visited his office on the last day of the war. Though Olmert says that he knew that the soldiers were killed from the start, the fact that such a report existed and that the prime minister had learned of it from a journalist caused a public uproar in Israel when it became known a year later.

I have covered Israeli hostage and M.I.A. cases for more than 15 years, including the covert ways in which Israel’s powerful espionage agencies operate to bring soldiers home alive or dead. Over that time, the issue has come to dominate public discourse to a degree that no one could have predicted. Israeli society’s inability to tolerate even a single soldier held in captivity results in popular movements that have tremendous impact on strategic decisions made by the government. The issue has become a generator of history rather than an outcome of it.

Why this is the case is difficult to say, because it requires a plumbing of the Israeli psyche. Certainly, part of it has to do with a Jewish tradition that sanctifies life, and with the necessity for Jews of a proper burial. And part, too, is rooted in the tradition expressed by Maimonides, that there is no greater religious duty than the redemption of prisoners — a powerful idea in a country whose citizens are required to be soldiers. As Noam Shalit emphasized, there is an “unwritten contract” between the government and its soldiers.

On the day Shalit was released, the country held its breath. Service in banks came to a halt because clerks could not stop watching the live video of Shalit’s movements, from Gaza to Egypt and then from Egypt to Israel. All over the country, banners and signs were hung, welcoming him home. Gilad was everyone’s son, everyone’s brother. To Israelis, his release was arguably the most significant event of the last 10 years. The exuberance at his return drowned out whatever protests existed of the deal that was made to bring him home.

It is hard to fathom the price Israel paid for Shalit without placing it in the context of previous prisoner swaps, originally with Palestinian organizations and later with Hezbollah. The first to grasp how sensitive Israeli public opinion was on the issue of hostages and M.I.A.’s — and therefore what a powerful weapon abduction could be — was Ahmed Jibril, the leader of a faction of the Popular Front for the Liberation of Palestine. In 1979, Israel reluctantly agreed to its first disproportionate exchange with a guerrilla organization when Jibril insisted on getting 76 P.L.O. members in exchange for one hostage.

Jibril’s greatest success came in the mid-1980s, when in exchange for three Israeli soldiers he demanded the release of 1,150 prisoners. The group included some of the most infamous terrorists held by Israel, includingKozo Okamoto, a Japanese Red Army member who participated in the massacre of 26 people at the arrivals hall in Lod Airport in 1972. In the wake of Jibril’s demand, Israel attempted to put counter-pressure on him by kidnapping his sister’s son, Murad al-Bushnak, whom Israeli agents lured to Beirut with promises of a weekend of sex, drugs and gambling. Instead, Bushnak was captured and taken to an underground interrogation cell, where he quickly gave up the phone number of Jibril’s home in Damascus. A senior intelligence officer dialed the number and made Jibril a simple offer: a quick swap, without anyone knowing, of Bushnak for the three Israelis. Jibril calmly upped his price to include his nephew.

If Jibril served as the inspiration for terrorist organizations, on the Israeli side it was Miriam Grof, the mother of one of Jibril’s Israeli captives, Yosef Grof, who became the model for the families of abductees. Without any experience in dealing with the media, Grof instinctively created strategies that have been used repeatedly by relatives of Israeli P.O.W.’s and M.I.A.’s. She grasped that public pressure on the government is a result of being aggressive and proactive: you make demands, not requests; you focus on what is important to you, not on the good of the country. One former high-ranking member of the I.D.F. recalled her saying that half the country could go up in smoke, just as long as her Yosef came home safe.

Eitan Haber, a respected military correspondent who later became a senior aide to Rabin, told me: “It is difficult to explain, but only someone who met that woman could understand how she filled everyone with a deep, blood-boiling, paralyzing sense of shame. We are speaking about three very tough men [Rabin, Peres and Yitzhak Shamir, the foreign minister] who had no problems saying no, but simply could not stand up to Mrs. Grof. What tipped the scales was not her tears or screaming or her teeth-grinding — all of which I remember clearly — it was the whole package. There was something menacing about her that threatened that the world was coming to an end. Her aggressiveness was not of this world. She broke them all down.”

In large part it was Miriam Grof’s battle for her son that allowed Jibril to get his deal: 1,150 Palestinian prisoners were freed, one of whom was the wheelchair-bound Sheik Ahmad Yassin, who later founded and led Hamas, the same movement whose suicide attacks exacted an enormous and bloody toll on Israelis, and the group that would one day capture Gilad Shalit.

In Lebanon, Hezbollah learned from Jibril’s tactics and perfected them. In January 2004, 435 Lebanese and Palestinian prisoners were released in exchange for the corpses of three Israeli soldiers killed in an ambush on the northern border, as well as one live hostage, Elhanan Tannenbaum. Tannenbaum was a shady businessman and a colonel in the reserves, who of his own free will went to meet Hezbollah agents who lured him to Dubai with the promise of a lucrative drug deal. In Dubai, his contacts sedated him, packed him in a crate and sent him via Iranian diplomatic mail to Beirut, where he was held in solitary confinement for more than three years.

The 2004 deal was led by Prime Minister Ariel Sharon, who more than any other Israeli leader stood as the symbol of Israel’s aggressive stance toward terrorism. Assaf Shariv, Sharon’s media adviser and later Israel’s consul general in New York, told me: “Sharon was wounded in combat in Israel’s War of Independence in 1948, left behind in the field and almost became a prisoner himself. He recalled that moment as a deep trauma and was haunted by visions of the bodies of Israeli soldiers and those taken captive in Jordan during the ’50s. He vividly remembered and gave horrific descriptions of them. He said of Tannenbaum, ‘I don’t care what he did, but I am not about to leave a Jew in the hands of those Arabs.’ I am sure that if Sharon had been prime minister during the last few years, he would have signed the deal for Shalit long ago. It turns out that even the toughest have their weak spots.”

In the asymmetrical war between Israel, with its powerful military and sophisticated intelligence apparatus, and the much weaker guerrilla groups who operate from places like Gaza, where daily life is one of constant deprivation, it is not hard to see how the latter have used Israel’s sensitivities regarding its citizen-soldiers to their advantage.

In September 1997, Hadi Nasrallah, the son of the Hezbollah leader Hassan Nasrallah, was killed in a skirmish with Israeli troops. The Israelis hoped that with his body in their hands, negotiations for the return of the bodies of Israeli soldiers held by Hezbollah would accelerate. Yaakov Perry, the former head of Shin Bet, Israel’s internal security service, was in charge of the case at the time. “We were optimistic,” he told me when we recently spoke. “We thought it would bring a solution closer, but Nasrallah was indifferent. He instructed his men not to put his son’s name at the top of the list and to treat him the same as all the other fallen militiamen. Later I heard that when Hadi’s coffin arrived in Lebanon, his father lifted the lid, glanced at the body of his beloved son and closed it. Not a muscle in his face moved.” The president of German intelligence at the time, August Hanning, who mediated an eventual deal between Israel and Hezbollah, told Perry in bewilderment that although Nasrallah grieved deeply for his son, “the body is another matter. You Israelis have a very unusual attitude on this matter.”

The “sensitivity” of Israel to the body issue has led to the absurd situation in which Israeli soldiers occasionally find themselves risking their own lives — some have been killed in the process — in efforts to extricate the bodies of their comrades from battle, so that those bodies won’t become bargaining chips for future negotiations.

Maj. Gen. Yaakov Amidror served as a senior officer in military intelligence for decades and today serves as national security adviser to the prime minister. “I believe that it is right to endanger the lives of soldiers in operational actions in order to bring about the release of a living hostage or to get information,” Amidror told me in an interview in 2009. “But the important principle is not to conduct any negotiation for the bodies of abducted soldiers or for living hostages. Israel has trapped itself in an impossible position, in which it sacrifices vital security interests in order to return hostages or their bodies, and this exceeds all the limits of reason. If, for example, it was clear to Hamas or any other organization that we do not pay anything and do not negotiate, the motivation to kidnap would be significantly lower.”

Two days after Shalit’s abduction, Prime Minister Ehud Olmert declared in the Knesset that he and his government were “dealing with only one matter” — securing the release of Shalit. Olmert’s capitulation to Hezbollah’s demands for the remains of the two soldiers set a precedent for the high price to be paid for the bodies of Israeli M.I.A.’s. The weight of these deals made bargaining for Shalit’s freedom nearly impossible.

Because the Israeli government refuses to speak directly to Hamas, negotiations in the months following Shalit’s capture were mediated by senior officers of Egyptian intelligence, who at the time had an office in Gaza (they were expelled when Hamas took full control of the Gaza Strip in 2007). In December 2006, an outline of an agreement was reached, under which Israel would free 450 Hamas prisoners from a list that would be agreed upon by both sides. In a second phase, after Shalit was repatriated, Israel would release another 550 prisoners (making a total of 1,000), whom it would select itself. The only point of contention was over who was to be included in the first list. For reasons that are not clear, Israel insisted that Hamas draw up the initial list. When it did so, predictably including the names of its most prominent prisoners — figures the Israeli government had vowed never to release — negotiations immediately came to a halt and remained there for the next two years.

Then, in late December 2008, while Shalit languished in an unknown location in Gaza and after the cease-fire was broken, Israel launched Operation Cast Lead. The stated goal was to liberate communities close to Gaza from missiles that were being fired on them from the strip, and the Olmert government took pains to say that the operation was not intended to win Shalit’s freedom. And yet, immediately following the operation, Israel announced that there would be no new cease-fire with Hamas — that border crossings with Gaza would not be opened and supplies designated for the population would not be allowed through — until the Shalit problem was solved.

In March 2009, negotiations between Israel and Hamas were held in Cairo, under the auspices of the Egyptian intelligence agency. Hamas insisted on the release of many of its top prisoners and, with few exceptions, refused to agree to their deportation from the West Bank, another major sticking point, as Israel feared that the released prisoners would embark on another wave of terrorism. Meir Dagan and Yuval Diskin, the chiefs of the Mossad and the Shin Bet respectively, opposed any deal. They produced data showing that 45 percent of those released in previous prisoner exchanges returned to terrorist activity. One example was a member of Islamic Jihad, Luay Saadi, who was arrested in September 1999 for providing logistical assistance to terrorists in the West Bank. According to Shin Bet, after his release in the January 2004 Tannenbaum deal, Saadi set up a widespread terrorist network that led to the deaths of 30 Israelis and the wounding of 300. He was assassinated by Israel in 2005.

There were a few dozen names on the Hamas list that the intelligence chiefs had vowed would never be released. One of these was Abbas al-Sayad, who dispatched the suicide bomber who blew himself up at a Passover seder at the Park Hotel in Netanya in 2002, killing 30 people, most of them senior citizens, and wounding 140. “People like that should never see daylight as free people,” Diskin, the chief of Shin Bet, said.

Olmert deliberated, and just before he left the prime minister’s office, in April 2009, he decided that the cost was too high to set so many murderers free. The deal collapsed.

On his last day as head of the Mossad, on Jan. 6 of this year, Dagan invited a group of reporters for an unprecedented visit to the organization’s headquarters, perhaps the most secret and well-fortified installation in Israel. We were driven there in a vehicle with blacked-out windows, then carefully searched before entering the building. During this meeting, Dagan sharply criticized the proposed deals for the release of Shalit. “Two hundred thirty-one Israelis were slaughtered by those freed in the Tannenbaum exchange,” he said. He recalled how in 1995 he informed a family that their son had been killed during an operation north of Nablus. “How can we go back to that woman and tell her that the man who killed her son and who was planning to murder many Israelis is being released, after he was sentenced to life imprisonment and after we told her he would never be released? What do we say to her?”

As negotiations for his son’s fate dragged on, Noam Shalit grew increasingly angry. Noam is an introvert, an industrial engineer for the Israeli company Iscar. His twin brother, Yoel, was killed in the Yom Kippur War in 1973, but Noam refrained from joining anti-government demonstrations at the time. By June 2008, though, immediately after the deal with Hezbollah for the two Israeli bodies, Noam emerged as the commander of an army of demonstrators and a growing protest movement. Advertising and public relations executives offered their services to him free. The country was flooded with posters, billboards and one marketing gimmick after another. At one point, Israeli citizens were offered the chance to “write a letter to Gilad” in a special font that was based on Gilad’s own handwriting. Numerous demonstrations were held in the center of Tel Aviv under the slogan “Asking for Gilad’s Forgiveness,” and on Facebook, hundreds of thousands of Israelis replaced their profile picture with a photograph of Shalit. At one point, a “prison cell” was set up in a TV studio, windowless and cramped, similar to the one in which Gilad was presumed held. Local celebrities vied to take hourlong turns sitting inside it, to feel what it would be like in his shoes — all of which was broadcast live.

Like Miriam Grof before him, Noam Shalit galvanized the nation. “Olmert is a political hack,” he told me during one of several conversations I had with him in 2010, in the protest tent that he and Aviva lived in on a sidewalk near the prime minister’s residence in Jerusalem. They sat there on white plastic chairs for more than a year, shaking the hands of tens of thousands of well-wishers who made the pilgrimage to visit them. The prime minister’s security detail did not dare to expel them from the site.

“This is a man who has never really understood the dangers of being captured behind enemy lines,” Noam said of Olmert. “I told Olmert that bringing my son back alive is not a real estate deal.”

He added, with uncharacteristic intensity: “Olmert had the nerve to look me in the eye after I said he wasn’t doing enough to free Gilad and say, ‘I don’t have a contract with any citizen of Israel that says that if he is taken prisoner I have to rescue him.’ That statement expresses a lack of understanding of the issue in all of its implications, not only on the fate of my son, but of far broader matters.” (Olmert says that he understood the Shalits’ request, but he adds: “As a prime minister, there are additional perspectives that I’m in charge of. There are things I will not do as prime minister of the state of Israel.”)

In the summer of 2009, Benjamin Netanyahu, who replaced Olmert in late March, decided that the Egyptian mediation was ineffective and enlisted German intelligence to negotiate a possible deal for Shalit. Over the next year and a half, the senior German agent in the Middle East, Gerhard Conrad, shuttled numerous times between Israel and Hamas. Under heavy secrecy, with the Israeli military barring publication of his name and photo, he moved around Tel Aviv, astonished that the billboards and the media campaigns on behalf of Shalit were having such a significant effect.

As reported by the German journalist Holger Stark of Der Spiegel, by late 2009 Conrad believed that he had managed to broker a compromise deal, but it was rejected by Netanyahu. He had set a limit to what he would agree: most of the freed prisoners would be deported and not allowed to return to their homes in the West Bank, and none of the names on Hamas’s “V.I.P. list” would be released.

More than a year went by, and the negotiations remained deadlocked. In January of this year, it seemed as if the Egyptian government under President Hosni Mubarak might succeed in pressuring Hamas into a compromise, but then came the Arab Spring. Suddenly there was no one to talk to in Cairo, and Hamas halted the negotiations.

Beyond the directors of the intelligence agencies, there were also Israelis who were opposed to making a deal with Hamas, mainly the families of victims of terror or members of the extreme right. In late 2009, when Conrad had almost closed a deal, dozens of families of victims gathered outside the prime minister’s office to protest against the release of killers. One of them was Yossi Mendellevich, with whom I spoke the week after Shalit was brought home.

Mendellevich described how, on the afternoon of March 5, 2003, he was talking on the phone with his 13-year-old son, Yuval, who was riding a No. 37 bus home from school in the port city of Haifa. “I cracked a joke, and Yuvie laughed and said: ‘Dad, you are so funny. I love you.’ Then there was a sound like an intake of air, like whoosh, and we were cut off. I didn’t think anything of it, because there were big problems with cellphones in Haifa at the time. About half an hour later, I got a call from someone asking if Yuval had come home, and I began to worry. Then I understood.”

Line No. 37 wasn’t chosen by chance. In the early afternoon it is one of the busiest bus routes in the city, carrying students from seven different schools. At 2:15 p.m., Mahmoud Kawasme, a Hamas member from Hebron, boarded the bus, moved to the center and detonated the explosives he was carrying. Seventeen people were killed, many of them schoolchildren, and more than 50 were wounded. Yossi Mendellevich identified Yuval’s body in the morgue. Soon afterward, he began waging a struggle against releasing terrorists.

The day after the Kawasme bombing, Israeli security services arrested four Hamas members who recruited him and sent him on his mission. Each of the planners was sentenced to 17 life terms. They were not meant to ever leave prison, but they were among those released in the Shalit deal. I have spoken with Mendellevich several times over the last few years, but he has never sounded so broken as he did in this recent conversation. “I am happy for Gilad and for his family,” he said, “but then I see the picture of Yuval, and sadness envelopes me again. You have seen a thing or two in your life: look at this picture of him. Sometimes you can see his innermost thoughts — the purity, the clarity, a kind of thing that is truly good. That is what he was, and my longing for him is as strong as the sense of loss that tears me apart.”< I asked him if he would like to kill the four who planned the bombing that killed his son, now that they are free. “Not I,” Mendellevich said. “I am a good boy. A confirmed conformist. I don’t even own a gun. I have not done what some other families have done and put a prize of $100,000 on their heads. But children don’t get on buses armed with guns, and there are law-enforcement agencies that are supposed to keep the criminals and killers off our streets. Now those same agencies go and turn the killers loose to come back to the streets, and this after they have become more extreme and more skilled, in the luxurious conditions they were kept in, in our prisons.” I asked him what should have been done. How should Shalit have been brought home? “No effort was made to put any pressure on Hamas,” he said. “Not to mention a military rescue operation. Today there isn’t a military leader with the guts to order a rescue operation or a commander in the army with the guts to recommend one. It’s possible to get to any place. The I.D.F. has proved this many times, but in the Shalit case, they simply never tried, out of fear that soldiers would be killed on the way.” In the spring of 2011, Netanyahu brought in a man named David Meidan to be his representative in the Shalit case. Born in Egypt, Meidan came to Israel as a child and has served for years in the Mossad, most recently as commander of the organization’s Tevel (“universe” in Hebrew) division, which coordinates operations with the intelligence services of other countries. Meidan was one of Meir Dagan’s favorites, although he had a radically different perspective on the question of prisoner exchanges.

Negotiations were at a dead end when Meidan took over the post, and he immediately began looking for new directions. “A lot of people offered themselves as mediators,” he told me in a conversation in mid-October. “When there is so much ‘intelligence noise,’ the problem is how to isolate the one thing that is likely to produce results. Both in my previous job and here I kept a sensitive ear open to try and identify that thing.”

Gershon Baskin, a Jewish peace activist, became the unlikely negotiator for Shalit's release. Credit Michal Chelbin and Oded Plotnizki for The New York Times

Gershon Baskin, a Jewish peace activist, became the unlikely negotiator for Shalit’s release. Credit Michal Chelbin and Oded Plotnizki for The New York Times

That thing, improbably, turned out to be an American-Israeli peacenik named Gershon Baskin, who moved to Israel in 1978 to form an N.G.O. devoted to coexistence between Jews and Arabs and who had been a vehement critic of Netanyahu’s for the past 15 years.

Six months before Shalit was abducted, Baskin was at a conference in Cairo, where he struck up a friendship with a professor at the Islamic University of Gaza, a member of Hamas whose name Baskin requested not be published. In the days after the abduction, when Israel launched Operation Summer Rains, the professor phoned Baskin and yelled: “Do something! Your government is bombing us nonstop. There’s no water and no power.”

Through the professor, Baskin was put in contact with Ghazi Hamad, Hamas’s deputy foreign minister, and it was this relationship, which took place largely through computer chats over a number of years, that ultimately led to the Shalit deal. Starting days after the abduction, through a relentless series of text messages, e-mail and phone calls, Baskin tried to convince the Olmert government and all other parties involved that he could help broker a deal. For years he was rebuffed as a nuisance by the Israeli officials dealing with the case.

The first message Baskin received from Hamad said that Hamas would free Shalit in exchange for an end to Israel’s blockade of Gaza, a total cease-fire and the release of 1,500 Palestinian prisoners. In an effort to make sure Olmert personally received the message, Baskin approached Olmert’s daughter, Dana, who agreed to speak to her father. Hamas wanted to know who Baskin’s channel to the prime minister was, so he told them about Dana. Shortly after, a senior Israeli intelligence official shocked Olmert by telling him that his daughter’s name had been mentioned by Hamas operatives. Out of concern for Olmert’s daughter’s safety, a member of Olmert’s staff called Baskin into his office and told him not to involve Dana. For the next five years, until David Meidan decided to take his call, Israeli intelligence rejected Baskin’s offers to help. But Baskin phoned Meidan the day he took the job. “Give me three weeks to get organized,” Meidan told him. “I don’t even have an office or a secretary.” Of their first meeting, Baskin said, “He explained to me that Netanyahu had come to a decision, against his own principles, to bring Gilad home.”

Meidan says that it was almost inconceivable that he would enter into a dialogue with the peacenik who said he could mediate a deal on Schalit, but because there was nothing to lose, he decided to try an experiment to see if Baskin’s channel of communication could be trusted. He asked Baskin to convey a message asking Hamas to prove that Schalit was still alive.

On June 14, Baskin and Hamad communicated via chat messages, Baskin speaking on behalf of Meidan and Hamad on behalf of Ahmed Jabari, the commander of the armed wing of Hamas, who was holding Schalit. Jabari’s is also the first name on Israel’s list of terrorists to be assassinated.

“There is no knowledge of how Gilad is for more than one and a half years,” Baskin wrote, “and Jabari or anyone else should not expect Israel to be serious about releasing 450 prisoners without exact knowledge on whether or not he is alive and well.”

Baskin communicated that there were two ways to establish proof of life. The first was a visit by the International Red Cross, in exchange for which Meidan agreed to grant family visits for Hamas prisoners in Israel who had not seen their families for more than four years. Conveying Meidan’s sentiments, he wrote, “a humanitarian gesture in exchange for a humanitarian gesture” and underscored that this was “a technical nightmare for Israel” but that Meidan was willing to ensure it would take place. The second option was a video showing that Schalit was alive.

Israeli intelligence tracked Baskin’s messages and found that the pipeline was reliable and accurate. For the next two months, Baskin transmitted the messages to Hamad without any embellishments, and Hamad passed them on precisely to Hamas leadership.

Meidan reported to Netanyahu: “It turns out that Phoenix” — the code name assigned to Baskin by the intelligence community — “is telling the truth, and our messages are going straight to Jabari.” Netanyahu gave his approval for the secret communication to continue. (A spokesman for Netanyahu declined to comment on any details of the Schalit release, referring me to his public statements.)

“After five years,” Baskin recounted, “this track was now official. I would go to sleep with my mind working on creative ideas — on what I would say to Ghazi, on a proposal for reaching a compromise. My mind was consumed with the negotiations. I was essentially conducting direct negotiations between the government of Israel and Hamas.”

In Israel, only the prime minister, the defense minister, the army chief of staff, Meidan and his team and the heads of Mossad and Shin Bet knew of Baskin’s involvement. It is strange, even unimaginable, that in the end it was a tenacious peacenik without a budget or agents who succeeded where such powerful intelligence agents had failed. “Someone from Egyptian intelligence told me that I hold each conversation five times,” Baskin says, “one for each of the spy agencies listening in on us.”

The process was made more difficult by the total lack of trust between the two sides. Here are extracts from a chat between Baskin and Hamad on July 25:

Baskin: “Is there any possibility that Jabari will authorize you to meet me in a third country other than Egypt?”

Hamad: “Gershon, he authorized me and give me full support but he is very sensitive to anything related to something given to Israel. He still have no trust with Israel. . . .”

Baskin: “Did he authorize you to negotiate?”

Hamad: “Hamas is afraid that can be used against them, direct contact with Israel. . . .”

Baskin: “Netanyahu has the same problem with direct contact with Hamas.”

In the end, thanks to Baskin’s persistence, Meidan persuaded Netanyahu to agree to send Hamas a vague message conveying readiness to compromise. This did not happen in a vacuum: Under intense domestic pressure — among other things, the country’s health care system was on the verge of collapse — Netanyahu was desperate for a positive development. Hamas also had its reasons for moving ahead — the Arab spring was exerting considerable pressure on the organization’s leaders in Damascus, who feared for their future if President Bashar Assad of Syria fell.

On July 14, Baskin received a message from Hamad saying that Hamas was offering a final resolution on the matter. Baskin faxed the document to Meidan, who as a cautious intelligence officer refuses to work with e-mail.

The Israeli negotiating team was surprised by the document. It promised there would be no further demands from the Palestinian side. Hamas promised to carry on from the point reached by Conrad, the German mediator in February 2011, with amendments that were less drastic than had been anticipated. “These are not simple demands,” Meidan told Netanyahu, “but with this we can begin to work.”

Meidan, who in the Mossad had been in charge of Israel’s secret-intelligence ties with Egypt under Mubarak, invited the ousted president’s successors, who were much closer to Hamas than Mubarak had been, to oversee and safeguard the negotiations. He informed them that he was even prepared to meet Jabari in person if necessary. Later, Netanyahu ordered him not to meet Jabari, and the two, who spent dozens of hours during the negotiations on opposite sides of the same wall, with the Egyptians shuttling messages between them, saw each other only in a corridor.

From Israeli intelligence it emerged that there was unrest within Hamas leadership, with some arguing that the matter would have been long settled had Jabari not refused to bend. Meidan called Baskin from Egypt and said:

“Get in touch urgently with Hamad and ask him if Hamas is Ahmad Jabari’s private business, because with his nonsense and games he is going to jeopardize the whole deal. Ask Jabari how it is that the whole organization, including the heads of the political wing, are scared of calling him to order.”

“The most difficult time,” Baskin recalls, “was two weeks before the agreement.” The Egyptians had placed a comprehensive draft agreement on the table, containing all the details. The Hamas representatives evaded giving an answer. “Suddenly, no one was getting back to me and all of my contacts were avoiding my calls,” Baskin said. “The terrible thought crossed my mind that perhaps Hamas did not really want to sign the agreement because they could not really carry it out — that Gilad was no longer alive.”

What was actually taking place was an internal dispute within Hamas. The political leadership was forcing the Egyptian proposal on Jabari, who wanted to continue stringing the Israelis along.

Ultimately, it was Israel that made the supreme compromise in agreeing to release terrorists whom it had vowed never to set free. While half of Hamas’s V.I.P. list remained in prison, those who were released were collectively responsible for the deaths of 600 Israelis and for wounding thousands. Some of them had been sentenced to hundreds of years in prison. German intelligence was amazed by these concessions, which Netanyahu himself had said he would never agree to.

Now Shalit is home, and Israel can only wait to see if the gamble Netanyahu took with the country’s security was justified or whether, as the deal’s opponents claim, the release of so many killers will encourage even more kidnappings and fuel the flames that are perpetually smoldering in the Middle East.

To a certain extent, the entire history of Israel’s prisoner exchanges prepared the country for this moment. Alongside the chronicles of regional security and Jewish tradition, it may have been a profound and bewildering sense of impotence — that Israel, with its mighty military, its legendary Mossad and its resourceful Shin Bet, is forced to stoop before its enemies — that led the masses into the streets to express their rage at the government and to demand that they bring Shalit home. It was clear that Israel would have to pay the price either way, the argument went, so why wait? Next time, said analysts firmly, a new set of clear rules would need to be devised; but this time, with Shalit languishing in jail for years without any alternative on the horizon, it must be signed before it was too late.

In 2007, a special commission was set up to determine a set of clear criteria to be followed in future prisoner exchanges. In order to protect negotiations on the Shalit deal, its details were not published, but I was told by a source in the ministry of defense that they include a warning against paying an exorbitant price to terrorist organizations in order to bring prisoners home, that the guiding principle should be bodies for bodies and small numbers of imprisoned terrorists for living hostages.

Perhaps this commission was asking Israelis to evoke an attitude that was more prevalent before the first Lebanon war of 1982 and the economic boom of the mid-’80s. It was the attitude in which one Israeli was willing to sacrifice himself for the collective, and in which the collective accepted this sacrifice. Looking back 35 years, it is undeniable that a shift has occurred in Israeli society. It is doubtful, when the time comes, that politicians will be able to resist public pressure and give up whatever is necessary, whatever percentage of the nearly 5,000 Palestinian prisoners still held in Israel, to bring the missing home.

There is perhaps some larger hope, though. After the deal went through, David Meidan reported to Netanyahu on the exchange and mentioned that he noticed a change in Jabari: he was wearing civilian clothes as opposed to the customary military uniform, appeared to be taking better care of his appearance, all of which softened his usual stern image. Meidan said to Netanyahu, “Something interesting is happening to Jabari.”

He also said that he believed the Egyptian-mediated channel established between Israel and Hamas for the negotiation could perhaps be used for other deals, and that from a point of total mistrust in April, a fragile mutual trust had been built between the two parties after the Shalit deal.

Others in Israeli intelligence believe, or perhaps hope, that the fact that the deal went through may indicate that Hamas’s stance is becoming more moderate, that the Arab Spring and the fall of Mubarak, with whom Israel shared a cold peace, might not pose as great a peril as Israel thought.

This fragile optimism, of course, will die immediately if one of the released prisoners takes part in the killing of Israelis, a fate that some intelligence officers say is inevitable. For now, though, the 80 percent of Israelis who supported the Shalit deal continue to rejoice. He is, as it is said there, everyone’s son. And will be until more fighting claims more lives and another soldier will take Gilad Shalit’s place in Israel’s collective conscience.

Originally Published at http://nyti.ms/1yQ1aTD