The Israeli army Sunday began tearing down a section of its separation barrier in the West Bank near a village whose weekly protests had become a symbol of opposition to the fence’s encroachment on Palestinian land.

The rerouting of the fence near Bil’in, after long delays, was a rare case in which Israeli defense officials have been forced to change plans by a court order. It was a victory for the Palestinian villagers, who have held weekly marches to the fence for several years, along with Israeli and foreign supporters. The demonstrations have frequently developed into exchanges of tear-gas and stones between Israeli soldiers and local youths.

The removal of the barrier came four years after the Israeli Supreme Court ruled on a petition by villagers that the route of the fence did not serve security needs, but cut through village farmland for purposes of expanding the adjacent Israeli settlement of Modi’in Ilit, a fast-growing town of ultra-Orthodox Jews. The court ordered the barrier torn down and rebuilt closer to the settlement.

Israeli officials have long asserted that the West Bank barrier, built in response to Palestinian suicide bombings, is intended to block attackers from reaching Israel. But the route of the barrier, composed of fences and walls, slices into the West Bank, looping around Israeli settlements in some locations and separating neighboring Palestinian villages from their lands. Critics of the project say it is designed to carve off territory Palestinians want as part of a future state.

At Bil’in, the fence cut the village off from a hill covered with olive trees, where a new neighborhood of Modi’in Ilit was planned. The Supreme Court said in its 2007 ruling that the planned expansion of the settlement was not sufficient grounds for fencing off the land, and ordered the army to relocate the barrier.

Delays by the Defense Ministry in implementing the decision led to two contempt of court rulings in response to motions by villagers. The court rejected two alternative routes for the fence proposed by defense officials, on the grounds that they left too much village land beyond the fence as reserve for expansion of Modi'in Ilit.

A third route was accepted in 2009, and the army built a new barrier, consisting of a wall running closer to to the settlement. On Sunday, bulldozers began tearing down the old fence, a section two miles long.

Col. Sa’ar Tzur, the regional brigade commander, told reporters that the new route would restore some 140 acres to Bil’in, leaving about 50 acres of village farmland beyond the new barrier route. Villagers say that the actual area of seized land is much larger than that, including parts of Modi'in Ilit.

Tzur said that the proximity of the barrier to the settlement would leave the army with less lead time to catch possible Palestinian infiltrators. “This is a new threat, but we can handle that,” he said, adding that work on removing the old fence would be finished by the end of the week.

Michael Sfard, an Israeli human rights lawyer who represented the Bil’in villagers in court, said that he had warned in a letter to the Israeli authorities several weeks ago that if the fence was not removed by July 1, he would file another contempt of court motion.

The Defense Ministry’s compliance with the court order at Bil’in was long overdue, Sfard said, adding that in delaying implementation, the ministry had “given preference to settlement expansion over fulfilling the court ruling to the letter.”