Warring Hamas and Faith factions in the Gaza Strip declared a cease-fire early Tuesday in an effort to end factional fighting that has left more than 60 Palestinians dead in the past two months.

The cease-fire was agreed at a midnight meeting between Prime Minister Ismail Haniyeh of Hamas and a representative of Palestinian President Mahmoud Abbas of the rival Fatah. Foreign Minister Mahmoud Zahar of Hamas said it would go into effect at 3 a.m. local time.

Zahar spoke after the meeting, flanked by Hamas and Fatah representatives and by Egyptian mediators. As he spoke, gunfire and explosions could still be heard in Gaza City.

Zahar said the agreement stipulated that all security forces must return to their bases, that suspects in killings are to be handed over, and that all hostages still being held — a number thought to be in the dozens — are to be released.

Several earlier truce agreements aimed at stopping the internal Palestinian bloodshed, raging fitfully since early December, have broken down.

Fatah spokesman Maher Mekdad said his group would observe the agreement.

"Despite all the bitterness and sadness that we are feeling, we will work to make it succeed," he said.

The agreement between the Palestinian factions came as a two-month truce between the Palestinians and Israel in Gaza was jeopardized by a Palestinian suicide bombing, the first since April, 2006. The bomber, a 21-year-old from Gaza, struck the Israeli resort city of Eilat, killing three people and himself.

The two radical groups that claimed to have sent the bomber said they were trying to end Palestinian infighting by taking aim at Israel instead.

Hamas , which controls the Palestinian parliament and Cabinet, praised the attack as legitimate resistance, and Israel hinted that a military response was being considered.

"This is a grave incident, it's an escalation and we shall treat it as such," Defense Minister Amir Peretz said.