JERUSALEM — Israel will substantially widen an army-patrolled zone at the southern end of the Gaza Strip near the border with Egypt, a step that will involve demolishing many Palestinian buildings, a senior Israeli official said Friday.

The official called the step necessary to protect Israeli soldiers who hunt for tunnels used by Palestinians for smuggling. In that area, five soldiers were killed Wednesday when militants blew up their armored vehicle.

Fighting raged there again on Friday, as soldiers continued trying to retrieve their comrades' remains from the sand.

Palestinian gunmen killed two soldiers and wounded two others as the troops were guarding the searchers, near the Rafa refugee camp. The Israeli army said that one soldier was killed when he left cover to help a Palestinian woman carrying large bags. The others were killed or wounded trying to rescue the first soldier, the army said.

With helicopter gunships overhead escorting dozens of armored vehicles, witnesses said that some residents of Rafa were gathering their belongings and fleeing, while others shut themselves in their homes.

"There's continuous shelling," said Naser Barhoom, the head of an Islamic charity in the area, speaking by telephone. "Tonight, I'm going to leave with my family."

In the fighting on Friday, bulldozers leveled several Palestinian homes near the Israeli zone where the five soldiers were killed earlier in the week. The army said that Palestinians were using the buildings to stage attacks. The zone is now about 4.5 miles long and 250 yards wide.

Even before this week's violence, the U.N. agency that oversees Palestinian refugee camps reported that, in the first 10 days of May, 1,100 Palestinians were left homeless in Gaza by the destruction of 131 residential buildings.

In all, the agency says, more than 17,000 Palestinians in Gaza have lost their homes to Israeli demolition since the start of the conflict in September 2000.

Israel says it demolishes Palestinians buildings only to protect soldiers and settlers, or to punish militants. Palestinians call the destruction a form of collective punishment.

Much if not most of the destruction has been in Rafa, a flashpoint where soldiers and militants trade blows nightly. Palestinians dig tunnels from Rafa into Egypt to smuggle weapons, cigarettes, and other contraband.

The army reports uncovering about 80 such tunnels over the course of the conflict.