An Israeli soldier held by the militant Palestinian group Hamas could be released as early as next week, the Israeli government said Wednesday, as officials shed new light on how the long-entrenched sides reached a prisoner swap deal that would allow more than 1,000 Palestinians to go free.

News of the imminent release was largely applauded in Israel, where Staff Sgt. Gilad Shalit, 25, has become a national hero after five years of captivity in the Gaza Strip. Palestinians in Gaza and the West Bank also expressed elation, as families prepared homecoming celebrations.

But the deal provoked sharp criticism from some Israelis, who called the release of Palestinian detainees reckless and questioned whether the deal would embolden Hamas, which controls Gaza and is considered a terrorist organization by much of the West.

The announcement of the deal Tuesday was unexpected, although Israel and Hamas had begun showing greater flexibility this year in talks mediated by Egypt.

The reverberations from Arab uprisings this year changed the political calculus of both sides as anti-Israeli sentiment in post-revolutionary Egypt soared and the Syrian government, one of Hamas’s chief patrons, began to fight for its survival amid a popular revolt of its own, according to Israeli and Palestinian officials.

Prime Minister Benjamin Netanyahu’s government concluded that the Syrian revolt, which has taken a heavy toll on a regime that has given Hamas financial backing for years, strengthened Israel’s position, an Israeli official said.

“The situation in Syria created a new set of realities that were difficult for Hamas,” the official said, speaking on the condition of anonymity to discuss private deliberations. “Suddenly, we saw a new flexibility that gave us hope of a more positive dynamic.”

Among other things, Hamas agreed that the swap would exclude senior Palestinian detainees and that a relatively small number of the 1,027 prisoners Israel is expected to release would be allowed to live in the West Bank or East Jerusalem, the official said.

Israel, meanwhile, agreed to forgo what it had once set as red lines, including in the deal the release of 27 Palestinian women and a small number of Arab Israelis, the Israeli official said.

Mustafa Barghouti, an independent Palestinian politician, said Palestinian leaders felt that Israel would be more willing to negotiate in the wake of the Arab Spring, which has made the prospect of any attempt to rescue Shalit, and possibly a new war in Gaza, riskier.

The Israelis “were mindful of the changes in Egypt,” he said, referring to a groundswell of anti-Israeli sentiment that had been suppressed under President Hosni Mubarak, who was ousted in the revolution.

Robert Blecher, an expert on Israeli and Palestinian affairs at the International Crisis Group, said both the Israeli government and Hamas’s leaders were desperate to appease restless electorates.

“In terms of the timing, it was the rare moment where both sides felt like they needed a win,” Blecher said.

Under growing financial strain, he said, Hamas has resorted to taxing Gaza residents more heavily. Palestinians in Gaza, he said, feel disappointed that the Arab Spring hasn’t done more for them.

“The Arab Spring has not paid the dividends they were hoping,” Blecher said. “Hamas’s popularity in Gaza has suffered.”

Netanyahu had been under similar pressure, with a flurry of domestic protests dominating news coverage here in recent weeks.

Israeli officials said they will disclose on Sunday the names of the Palestinians who will be released. Israelis will have two days to voice their opposition to the Supreme Court. If the court doesn’t block the deal, the swap could begin as early as Tuesday, government officials said.

The deal comes with high political risks for Netanyahu. Although most members of his cabinet signed off on the swap, three voted against it, saying it would make Israelis vulnerable.

“This deal will be a huge victory for terror,” Uzi Landau, the minister of national infrastructure, told reporters Wednesday. “It will be a blow to Israel’s deterrence and the security of Israel.”

Abu Obeida, a spokesman for Hamas’s military wing, was quoted on Palestinian Web sites Wednesday as saying that the movement would continue to fight for the release of all of its members in Israeli custody.

“Shalit would not be the last” Israeli soldier abducted as long as Israel continues to detain Palestinians, Obeida was quoted as saying.

Special correspondent Samuel Sockol contributed to this report.