JERUSALEM (AP) -- The elaborate machinery of a prisoner swap deal between two bitter enemies swung into motion early Tuesday, as hundreds of Palestinians and one Israeli soldier prepared to return home in one of the most dramatic recent developments in the otherwise deadlocked Israel-Palestinian conflict.
Before dawn Tuesday, the first 96 inmates were moved from a prison in the south to another in the West Bank, where they were later to be released, a spokesman for Israel's Prisons Service said.
The Israel-Hamas deal, to take place Tuesday morning, is going ahead despite criticism and court appeals in Israel against the release of 1,027 Palestinians for a single captured Armored Corps sergeant, Gilad Schalit, held by militants in Gaza since 2006.
The exchange, negotiated through mediators because Israel and Hamas will not talk directly to each other, involves a delicate series of staged releases, each one triggering the next.
When it is over, Schalit -- 19 years old at the time of his capture, and 25 now -- will be free, ending what for Israel has been a prolonged and painful saga. Israel was forced to acknowledge that it had no way of rescuing Schalit in a military operation, though the soldier was held no more than a few miles (kilometers) from its border.
Instead, Israel agreed to a lopsided prisoner exchange that Hamas officials have openly said will encourage them to capture more soldiers, and which will free Palestinians convicted of some of the deadliest attacks against Israeli civilians in recent memory.
Numerically uneven swaps for captured or dead Israeli soldiers held by armed Arab groups have taken place a number of times since the 1980s. The last one, in 2008, saw the release of five militants in return for the bodies of two Israeli soldiers held by the Lebanese group Hezbollah. In a deal with Hezbollah in 2004, Israel freed about 400 prisoners in return for a former army colonel and the bodies of three soldiers.
When Tuesday's exchange is complete, 477 Palestinians held in Israeli jails will have been released, several of them after decades behind bars. Another 550 are set to be released in two months.
Palestinians slated to be part of the initial part of the exchange have already been moved from their original prisons to other Israeli penal installations in preparation for their release. The very first group, 27 women, are to walk free sometime after dawn Tuesday.
After that, Hamas is supposed to move Schalit from Gaza through the Rafah border terminal into Egypt, where he will be met by Israeli medical personnel, according to Israeli defense officials.
Once the soldier is in Egypt, the officials said, the rest of the prisoners will be released under the terms of the exchange agreement. About 100 will be sent to the West Bank, and roughly 30 are to be deported to Jordan, Turkey, Qatar and Syria, which agreed to take prisoners who Israel insisted not be allowed to return home, according to Hamas officials. The rest will be freed in Gaza.
Schalit will be brought to an Israeli military base along the Egypt border, where he will be issued a new military uniform and given another medical examination, according to the Israeli military. Although he appeared healthy the last time he was seen -- in a brief and scripted 2009 video released by Hamas -- he was denied all visits, including by the Red Cross, and the state of his mental and physical health is unclear.
Schalit will then be flown by helicopter to an air force base in central Israel, where he will meet his parents, as well as Israeli Prime Minister Benjamin Netanyahu, the defense minister and military chief of staff.
From there, he will be flown to his family's home in northern Israel.
The swap drew an emotional response from some in Israel because of the number and identities of the prisoners.
Among those being released are militants involved in planning and executing suicide bombings in restaurants and on buses during the years of the second Palestinian uprising, which began in 2000.
One woman, Amna Muna, was convicted of luring an Israeli teenager over the Internet onto Palestinian territory, where another Palestinian killed him. Another prisoner, Nasser Yateima, was convicted of masterminding a hotel bombing that killed 30 people celebrating the Passover holiday in 2002.
Also among those being released were two Gaza militants convicted of playing minor roles in capturing Schalit. One filmed the operation on behalf of Hamas, and the second transported some of the militants who crossed into Israel, seized the soldier and killed two of his comrades.
Palestinians see the prisoners as freedom fighters whose actions were justified in the context of their struggle against Israel. In the violence of the second Palestinian uprising, which was eventually put down by Israel's military, more people were killed on the Palestinian side.
The planned celebrations for their release were to be attended both by officials from Hamas, the Islamic group that captured Schalit and negotiated the deal, and from the Palestinian Authority, the Western-backed government that wields partial control in the West Bank.
Among Palestinians, the exchange appeared likely to strengthen Hamas, which is dedicated to Israel's destruction, at the expense of the rival Fatah movement, which dominates the Palestinian Authority and says it wants to peacefully create a Palestinian state alongside Israel.
In Israel, public pressure for a deal was intense. Thanks in part to a vocal campaign led by his parents, Schalit had become a symbol of national solidarity in a country where military service is mandatory for Jewish citizens and where the government is seen as responsible for bringing soldiers home.
In Israel, relatives of victims of Palestinian attacks filed court appeals aimed at stopping the deal. One was filed by the surviving members of the Schijveschuurder family, whose parents and three siblings were killed when a Palestinian suicide bomber blew up a Jerusalem pizzeria in 2001, killing 15.
At an emotionally charged Supreme Court hearing Monday, Noam Schalit, the soldier's father, urged the judges not to delay the exchange. Late Monday, the court decided not to intervene, removing the last hurdle for the deal to go through.
A poll published Monday showed an overwhelming majority of Israelis -- 79 percent -- supporting the deal. Only 14 percent were opposed.
The poll was carried out by the Dahaf Institute and published in the daily Yediot Ahronot. Pollsters interviewed 500 respondents, and the margin of error was 4.4 percentage points.
An Egyptian security official said that an American-Israeli dual national held since June in Egypt on suspicions of espionage would also be released shortly after the swap. Ilan Grapel will be released by Egypt in return for about 70 Egyptian prisoners, most serving sentences in Israel on charges of smuggling or illegal entry, the official said.
Israel has denied that Grapel, a law student who was traveling under his own name and whose connections to Israel were easily apparent on his Facebook page, was a spy.
The official spoke on condition of anonymity because he was not authorized to brief the media on the matter. He would not give a precise time for Grapel's release, and Israeli officials would not comment.