Gun battles continued last night at the end of one of the worst days of fratricidal violence in the Gaza Strip, despite news that the main Palestinian parties had agreed a ceasefire.

Walid Awad, a spokesman for President Mahmoud Abbas' Fatah party, said Fatah and Hamas had agreed to withdraw all armed men from the streets of Gaza and the West Bank. They also agreed to release all the people they had kidnapped from each other. Under the deal, negotiations for a national unity coalition would resume and all demonstrations have been prohibited for the foreseeable future.

Tawfik Abu Khoussa, another spokesman for the party, said: "Fatah is trying to control its forces. We have serious intentions of stopping the fighting. It is now up to the other side to also stop firing."

But it was unclear whether the deal would take hold as intense gun battles continued outside the house of Fatah official Mohammed Dahlan's house in Gaza. The violence is threatening to overshadow Tony Blair's attempts to revive the peace process as his plane touched down in Tel Aviv last night, on the final leg of a tour of four Middle Eastern states.

Earlier in the day, pro-Fatah gunmen fired automatic weapons at a convoy ferrying Mahmoud Zahar, the Hamas Foreign Minister, to his office in Gaza City. Mr Zahar escaped unharmed from what Hamas condemned as an attempted assassination. Pro-Hamas militiamen retaliated with shots at the home of Mr Abbas, the Fatah President, and two mortars were fired at his office, wounding five guards.