Updated

Hamas gunmen killed two Palestinian policemen loyal to the rival Fatah movement early Wednesday, hours after the sides agreed to a new cease-fire meant to end more than a week of factional fighting.

Fatah officials condemned the killing but said they remained committed to the truce, and Gaza City remained largely calm at midday — a dramatic contrast to the pitched battles that raged in city streets a day earlier. However, hundreds of people went on a violent rampage at the policemen's funeral, raising the prospect of renewed fighting.

Fatah spokesman Tawfiq Abu Khoussa said the policeman, cousins in their early 20s, were killed when their vehicle was attacked during an overnight patrol. Six other people in their car were wounded, he said.

"They came under fire from an ambush of masked gunmen affiliated with Hamas," Abu Khoussa said.

Click here for more news on the Middle East.

He said Fatah considered the shooting a violation of the cease-fire, but would still honor the truce, announced just before midnight by President Mahmoud Abbas.

"Fatah is still committed to the agreement and to the announcement by President Abbas last night," he said.

About 300 people attended a funeral for the dead officers Wednesday. Many of the men were armed, shooting in the air and calling for revenge.

At one point, the funeral procession passed by the house of Foreign Minister Mahmoud Zahar, a top Hamas official, and mourners shouted epithets. Zahar apparently was not in the area at the time.

The funeral procession crowd later went on a rampage near the cemetery where the bodies were buried, torching several cars believed to belong to Hamas.

Four cars were riddled with gunfire and badly charred, and smoke covered the windows of a nearby building belonging to the local electric company. The destroyed vehicles turned out to be cars belonging to the company.

Two TV cameramen filming the incident were roughed up by protesters, who also confiscated their videotapes and smashed them.

Hamas' Web site described the fatal shooting as "an intense gunbattle ... between Fatah and the (Hamas) executive unit." It said "the identity and the affiliation of the people killed is still unknown."

Elsewhere in Gaza, life appeared to be returning to normal. Cars and donkey carts were back on the streets, and people were busy running errands. Police were conducting routine patrols, but there was no sign of Hamas' armed militia.

The previous day had brought some of the heaviest fighting yet in the latest round of violence, bringing lift to a standstill in much of Gaza.

Students took cover in classrooms, motorists exchanged warnings about no-go zones and families fled beachside apartments as intensifying factional fighting brought life to a standstill in much of Gaza.

Five people were killed and 18 wounded, including five schoolchildren, in the day's fighting, which derailed a truce reached earlier in the week.

Late Tuesday, Abbas announced a new truce deal. ""There will be a comprehensive cease-fire in Gaza to end all military demonstrations, all shooting will stop and random deployments (of armed men) will end," he said.

The agreement came shortly after Prime Minister Ismail Haniyeh of Hamas appealed for calm in a televised speech, urging the Palestinians to band together to fight the common enemy: Israel.

The fighting erupted last week after months of political tensions between Hamas and Abbas' Fatah movement. Hamas, which is committed to Israel's destruction, defeated Fatah, which favors peace talks with the Jewish state, in legislative elections early this year.

The violence intensified after Abbas announced Saturday that he was seeking new elections to end the political deadlock, a direct challenge to Hamas' control of the Cabinet and parliament. In all, 16 people have died in the clashes, one of the deadliest bouts of Palestinian infighting.