GAZA CITY, Gaza Strip (AP) – Hamas militants whisked a captured Israeli soldier across the Gaza border into Egypt early Tuesday, beginning an elaborate prisoner swap deal in which hundreds of Palestinian inmates are to be freed in return for the captured tank crewman.

The officials said an SUV filled with armed men took Sgt. Gilad Schalit across the border and quickly returned to Gaza early Tuesday. Buses of Palestinian prisoners were also beginning to move from Israel into Egypt en route to Gaza, they said.

A Gaza militant leader said the Palestinians were waiting until all 477 prisoners were moved into Palestinian territory before turning Schalit over to the Egyptians. In the meantime, he said armed men would remain with Schalit in Egypt.

“The captured soldier handover process is under way, and the Palestinian resistance groups are about to finalize his handover to Egypt,” said Abu Mujahid, whose Hamas-allied group, the Popular Resistance Committees, helped captured Schalit in a June 2006 cross-border raid.

The deal caps a five-and-a-half year saga that saw multiple Israeli military offensives in the Gaza Strip, an Israeli blockade on the territory and numerous rounds of negotiations that ended in deadlock.

Officials on both sides have said that conditions prompted in part by the recent Egyptian revolution helped drive them to an agreement. Both sides have been eager to have good ties with the new Egyptian regime, which brokered the deal.

In all, Israel is slated to release 1,027 prisoners for Schalit–with the final 550 to be freed in about two months.

Before dawn, convoys of white vans and trucks transported hundreds of Palestinian prisoners to the locations in the West Bank and on the Israel-Egypt border where they were to be freed. In Gaza, the Red Cross confirmed that the prisoners slated for release had arrived at the nearby border crossing.

About 200 relatives of prisoners waited at a West Bank checkpoint as the exchange unfolded.

“We’re so excited we can barely breathe,” said Mariam Shkair, waiting for her brother, 52-year-old Abdel Latif, who spent 25 years in prison for killing an Israeli soldier. “We are waiting to hug him.”

Some of the relatives raised Palestinian flags or the green banners of Hamas. A group of young men chanted, “We will continue our struggle.”

The exchange, negotiated through Egyptian mediators because Israel and Hamas will not talk directly to each other, is going ahead despite criticism and court appeals in Israel against the release of the prisoners. Nearly 300 of them were serving lengthy sentences for involvement in deadly attacks.

The exchange involves a delicate series of staged releases, each one triggering the next. The Red Cross and Egyptian officials are involved in facilitating the movement of prisoners.

In Gaza, Hamas militants deployed in force along the road leading into Egypt where Schalit was to be taken. Shortly thereafter, hundreds of returning Palestinians were slated to enter Gaza on the same road.

When Tuesday’s exchange is complete, 477 Palestinians held in Israeli jails, including 27 women, will have been released, several of them after decades behind bars.

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 in the only time he has been seen in captivity–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 Prime Minister Benjamin Netanyahu, the defense minister and military chief of staff.

An intense media campaign to free Schalit made him a national symbol in Israel, and all local radio and TV stations held special live broadcasts Tuesday, following every step of the exchange.