The agreement between Hamas and the Palestinian Authority was reached on Tuesday during meetings between President Mahmoud Abbas and senior Hamas officials, said Hamas spokesman Mushir al-Masri on Thursday.
Hamas, however, turned down a request by Abbas that it forego victory celebrations during the pullout, and reiterated it would not disarm, al-Masri said.
Israeli and Palestinian security officials also announced they would set up a joint operation centre to monitor the withdrawal. The centre is the latest sign of security cooperation between the groups.
Beginning on Wednesday, Israel plans to evacuate the 21 Jewish settlements in Gaza along with four small enclaves in the West Bank, ending 38 years of occupation in the area.
The Israeli military on Thursday banned visitors from the Gaza settlements to keep out additional anti-pullout protesters from reinforcing settlers who plan to resist being moved.
Mushir al-Masri (R) said Hamas
would not accept a marginal role
Police estimated that 2000 Israelis are in Gaza illegally. Jewish settlers put the number at 5000. Many overstayed entry permits for visitors and relatives.
The ruling Fatah movement and Hamas have been battling over who should get credit for the withdrawal.
Hamas claims its repeated attacks on Israeli targets over the past five years have forced the Israelis to abandon Gaza.
While the resistance group enjoys widespread popularity in Gaza, the Palestinian Authority is hoping to make a comeback if it delivers some achievements after the pullout, winning some freedom of movement for fenced-in Gazans and creating jobs in the impoverished area.
Hamas leader Mushir al-Masri said both organisations had "agreed on forming a committee to oversee the withdrawal and ensure that no one will benefit from the public properties, except the Palestinian people.
"Hamas will not accept a marginal role in the withdrawal," he added, though he conceded the committee would "not be an alternative to the Palestinian Authority and will not run the Gaza Strip."
He also said Hamas had received assurances that jobs in government offices and security forces would be open to all Palestinians, not just members of Fatah.
"All of us should convey a unified face to the world that we are a freedom-fighter nation looking for our freedom ... not rival factions working for personal interests or party interests"
Islamic Jihad leader
Samir Mashrawi, a prominent Fatah leader in Gaza who participated in the negotiations, confirmed the deal in an interview on Voice of Palestine Radio.
In a speech to the Palestinian parliament on Tuesday, Abbas called on all Palestinians to ensure calm during the Israeli pullout.
He urged Palestinians not to loot abandoned Jewish settlements, and called on resistance fighters to refrain from excessive celebrations and lay down their weapons after the pullout.
Al-Masri said Hamas reserved the right to celebrate if it wants. "The way we celebrate is our own business," he said. He also rejected the call to disarm, saying the group wants to remain prepared for a possible Israeli return to Gaza.
In a boost for Abbas, the other Palestinian resistance group Islamic Jihad called for a central celebration after the withdrawal, flying Palestinian flags.
"All of us should convey a unified face to the world that we are a freedom-fighter nation looking for our freedom ... not rival factions working for personal interests or party interests," said Muhammad al-Hindi, an Islamic Jihad leader in Gaza.