A Palestinian woman walks past a mural depicting captured Israeli soldier Gilad Shalit in Jabalya in the northern Gaza Strip on Wednesday. Israelis welcomed on Wednesday a major prisoner swap that will free soldier Gilad Shalit after five years in captivity in return for the release of 1,000 Palestinians.

Even amid images of Hamas’ victory celebrations in Gaza and the risk of releasing militants serving terms for terrorist attacks, the Israeli leader broke with his no-compromise approach to terrorism by siding with Israeli public sentiment that is overwhelmingly sympathetic with Shalit’s plight.

"There’s no avoiding the dissonance. This is a violation of principles that he laid out and helped establish him as a public figure: You don’t surrender to terrorist blackmail," says Yossi Klein Halevy, a fellow at the Shalom Hartman Institute in Jerusalem. "Netanyahu has deeply held principles, but in the end he is a pragmatist. And he has proven that again and again even though the world doesn’t give him credit for it."

As the Israeli media hailed the news of Shalit’s release, the head of the Shin Bet security agency, Yoram Cohen, told journalists that although the deal could encourage new attacks and strengthen Hamas at the expense of moderates, it was the minimum price Israel could expect to pay to bring Shalit home.

'The deal of Netanyahu's life'

During his first term in office in the 1990s, Mr. Netanyahu implemented West Bank withdrawals under the Oslo Accords that he had disparaged as a opposition leader, and even shook hands with long-time Palestinian guerrilla fighter Yasser Arafat, who had abandoned violent rhetoric and began seeking a peace deal with Israel. At the beginning of his second term as prime minister in 2009, Netanyahu broke with the ideological hard-liners in his decision to support the creation of a Palestinian state and back a moratorium on new settlement houses in the West Bank.

[ Video is no longer available. ]

But in the past year, that trait has been obscured by his decision to renew settlement building, a move which focused blame on him for the breakdown of peace talks. More recently, he was criticized for hurting Israel’s strategic position by refusing to apologize to Turkey for a naval raid that killed nine Turkish activists on a Gaza-bound aid flotilla last year.

In an article headlined "the deal of Netanyahu’s life," Yossi Verter, a columnist in the liberal Haaretz newspaper said the decision was the most important of his current term.

"He hasn’t embarked on war. He hasn’t made peace," he wrote. "It is often said that Netanyahu is more a politician of speeches and words, and less of deeds. This time Netanyahu behaved like a leader."

The Israeli leader’s credentials as counterterrorist crusader go back to the killing of his older brother Yonatan during the 1976 Entebbe Operation to release Israeli hostages from a plan hijacked to Uganda. After entering politics he authored a book titled "Fighting Terrorism.’’

His agreement to the Shalit prisoner swap reflects widespread Israeli support for paying a high price for the freedom of POWs as a means of keeping morale high among foot soldiers in the country’s citizen army and their families.

Shalit campaign

That sentiment was symbolized Noam Shalit, Gilad's father, who together with his wife, Aviva, led a 10,000-person march across Israel in June 2010 and camped out on the sidewalk, swearing not to leave until their son came home. After the deal was announced last night, 300 revelers danced, shouted, honked, and prayed in the street to herald Shalit’s return and hear his parents’ exhausted victory speeches.

After months of publicly berating Netanyahu for not finalizing the deal, Noam Shalit today praised the prime minister for a "courageous decision."

Ohad Kaner ran the tent for the past 14 months, each day updating the number of days Shalit had been in captivity. On Wednesday it was day 1,935.

“For everyone who wanted to come here and support the family and express himself, sit with us, experience the pain and shout the shout of Gilad – this was really the only way,” Mr. Kaner said. “It took a long time, but at the end of the day [Netanyahu] showed leadership and made a brave decision.”

When Gilad’s brother Yoel arrived at the tent with his girlfriend today, Israel’s Chief Rabbi Yona Metzger blessed the secular young couple and noted the timing, signed just after the Jewish new year.

Activist Hadar Winter, who manned the tent each weekend to pressure the government and offer sustenance to Gilad's family, says she is sure the campaign – in the tent, in protests, and in the press – did its part.

“The prime minister, it wasn’t pleasant for him to pass here every day when people sat in the tent right on his house,” she says.

Ms. Winter guessed Shalit would have no concept of the scope of the campaign in his name, which spread across Israel and the world. She said activists have saved him letters, guest books, videos, and posters.

A tactical dividend for Netanyahu

Netanyahu's decision to release 1,000 Palestinian prisoners for Shalit was not only a nod to public sentiment, however. It also is likely to yield another tactical dividend: By boosting Hamas, it will shift attention away from Palestinian Authority President Mahmoud Abbas's diplomatic campaign for United Nations statehood recognition – a move Israel bitterly opposes.

That may be a consolation for a leader who likely might have criticized the same deal if he weren’t saddled with the pressures of facing daily protests and reminders of Shalit’s plight.

"Netanyahu was opposed to it in principle. He said, 'It goes against everything I believe in, but it's time to bring him home,' " says Gershon Baskin, who helped mediate the deal. "After five years, enough was enough.’’