Updated

Israeli police encircled thousands of Gaza withdrawal opponents Tuesday, confining them to a fenced-in farming village to prevent them from marching to the nearby Gaza Strip in protest.

Scuffles broke out as demonstrators tried to pushed through the police cordon.

It was the biggest showdown between protesters and security forces since Prime Minister Ariel Sharon announced last year he would dismantle all 21 Jewish settlements in Gaza and four in the West Bank.

Sharon signaled he would stand tough.

"Ariel Sharon is not scared of 20,000 or 50,000 marching settlers," said the prime minister's closest ally in the government, Vice Premier Ehud Olmert (search).

Marchers settled into a makeshift camp outside the farming village of Kfar Maimon (search), 10 miles east of the Gaza border. Israeli Defense Minister Shaul Mofaz (search) said they would not be allowed to move any closer to Gaza, setting the stage for possible confrontations.

After a first day of marching Monday and a night spent in sleeping bags and tents, demonstrators wrapped in white shawls held morning prayers on a dusty lot, swaying back and forth. As the summer heat intensified, families sought shade under trees and children played games.

Demonstrator Avraham Ravi, 33, brought along his four children, ages 1 to 8. He sat with his wife and children under a tree in Kfar Maimon, preparing for the second day of the march.

"We walked all night. It wasn't easy with the kids," said Ravi, from the West Bank settlement of Tel Menashe. "But we tell them that this is to block those people who want to divide Israel."

Police have declared the march illegal. Regional police commander Uri Barlev said demonstrators could remain in Kfar Maimon indefinitely but would not be allowed to move west, to Gaza. Police were deployed around the fenced-in village, and at roadblocks leading from Kfar Maimon to Gaza.

Police estimated about 7,000 marchers had assembled in Kfar Maimon, while organizers put the number at more than 20,000.

Settler leader Pinchas Wallerstein (search) said the protest could last many days.

"As long as this terrible decision stands, there will be a constant presence to prevent this," he told Israel Army Radio. He said the protesters would try to keep moving toward Gaza. "Wherever they stop us ... we will stay," he said.

The marchers want to reach Jewish settlements in Gaza to participate in resisting the withdrawal, set to begin in mid-August. Police last week declared the Jewish settlements a closed military area, meaning only residents can come and go.

Police also tightened security along barricades at the Kissufim crossing, the gateway from Israel to the Gaza settlements, adding rolls of barbed wire and concrete blocks.

In the West Bank, two Palestinian militants were killed in a gun battle with Israeli troops Tuesday, the military said. Security forces surrounded the militants' hideout in the village of Yamoun, and after the firefight demolished the building with bulldozers.

The army said the gunmen were members of two militant groups, Islamic Jihad (search) and the Al Aqsa Martyrs' Brigades (search), which has ties to Palestinian leader Mahmoud Abbas' Fatah movement.

Israel has intensified arrest raids of militants after six Israelis were killed last week, five in a suicide bombing by Islamic Jihad and one in a rocket attack by Hamas (search). Militants also fired a barrage of rockets and mortar rounds at Israeli communities in and near Gaza. Israel carried out several air strikes last week, killing six Hamas militants.

The weekend violence endangered a five-month-old truce. But Israeli and Palestinian leaders said Monday they would try to stop the escalation. Olmert said troops amassed outside Gaza would not invade the strip if Abbas can subdue the militants.

Abbas, in turn, said that he would negotiate with the militants to try to rescue the cease-fire, seen as the main achievement of his six months in office. However, he also warned militants they must refrain from acting on their own.

"Nobody has the right to take the law into his own hands, nobody," he said Monday.

Tensions between Palestinian police and militants in Gaza have been running high in recent days as Abbas comes under increasing U.S. and Israeli pressure to rein in and disarm militant groups.

On Tuesday, Hamas gunmen and Palestinian security forces exchanged fire after two Hamas-affiliated research companies were burned down, witnesses said. Six people were wounded in the shootout.

During the fighting, Hamas activists burned two cars belonging to members of Abbas' ruling Fatah movement, and fired a rocket-propelled grenade at another vehicle. Fatah activists burned a car belonging to Hamas.

Al Aqsa members later threatened to respond in kind if attacked by Hamas.

In a clash between Hamas and Palestinian police last week, two bystanders were killed.