As the Israeli army turned its attention to emptying the fortified settlements it spent decades guarding, Palestinians began returning to their own houses on this town's ragged edge, the side facing the sniper towers and tank revetments.

Pocked by bullets and emptied by fear, the gray, cinder-block homes on the northwest side of Khan Younis define a front line as ugly as the battles fought along it. Empty cartons and old diapers litter the sand streets, and the breeze from the sea -- a hazy blue field visible beyond the red tiled roofs of the Neve Dekalim settlement and the military emplacements that guard it -- carries the stink of raw sewage that forms pools along broken steps.

"One of my priorities is to go to the beach. It's been five years," said Ibrahim Ali, back in the house his family evacuated under fire more than a year ago. Ali, 35, stood in blue jeans among a crowd of children testing the new tolerance of the Israeli forces who cut off access to the shore after the Palestinian uprising that erupted in 2000. By early afternoon, the youths had advanced 100 yards beyond the perimeter that snipers had enforced a day earlier, zinging warning shots from watchtowers to drive the onlookers back.

On Tuesday, crowd control fell to Palestinian security forces, Arab men in green fatigues who trudged after the youngsters. One teenager boldly unfurled the green flag of the Islamic Resistance Movement, known as Hamas, which had staged a rally just a block away earlier in the day, with dozens of young men in black masks marching in place with rocket-propelled grenade launchers on their shoulders.

"Hamas will not disturb this pullout, and we will temporarily stop sniping at soldiers," a speaker announced from an improvised podium on the roof of a vehicle. Members of the crowd identified him as Younis Astal, head of the local Hamas branch. He urged gunmen to retain their weapons, insisting that attacks on Israeli settlers and soldiers had driven Israel to abandon Gaza.

"Without jihad, without attacking the settlements, digging the tunnels, launching the rockets, the Israelis wouldn't have moved," he said.

The claim reflects Hamas's tension with the other major Palestinian party, the Fatah movement led for decades by Yasser Arafat, who died in November. With control over the governing Palestinian Authority, Fatah promotes a less militant course, arguing that international sympathy will force Israel to negotiate the return of the occupied territory. Both parties say they will compete in legislative elections set for Jan. 21.

"Let me be clear," Saeb Erekat, the chief Palestinian negotiator with Israel, said at a news conference in Gaza City, "Palestinian political life will be based on ballots, not bullets."

In Gaza, where 1.3 million Palestinians are crowded into a narrow strip, the toll of fighting at close quarters was vividly evident among the residents returning to Khan Younis.

"A week ago, we didn't have the guts to sleep here at night," said Amina Abu Obeida, who returned two days ago to the house she had fled five years earlier with three members of her family of five nursing wounds from stray bullets. One daughter was wounded in the head, another in the spine, and Obeida caught shrapnel in her hand.

"Now we'll stand fast here," Obeida said. "We're sick of moving from one place to another."

Palestinian security forces stand guard to prevent Hamas supporters celebrating the Israeli pullout from reaching the wall of the Neve Dekalim settlement.