In an embarrassing blow to Israel, the Supreme Court on Tuesday ordered the state to redraw the route of its West Bank separation barrier near a Palestinian village that has come to symbolize opposition to the enclosure.

Residents of the village of Bilin went to court arguing that the current route, built on village land, kept them from their fields and orchards, which remained on the other side of the barrier. Villagers and their Israeli and foreign supporters have protested at the barrier every Friday for the past 2 1/2 years, routinely sparring with police in clashes that have wounded dozens.

The Israeli government argued that the route was necessary to protect residents of the nearby settlement of Modiin Illit, and completed the section of fence that cut through Bilin's lands despite the protests.

A three-judge Supreme Court panel unanimously rejected the government's argument Tuesday, ordering defense planners to change the barrier's route so it causes less harm to the village's residents.

"We were not convinced that it is necessary for security-military reasons to retain the current route that passes on Bilin's lands," Chief Justice Dorit Beinish wrote in the decision.

The judges specified that "this will require destroying the existing fence in certain places and building a new one," and ordered the government to come up with a new route in a "reasonable period of time."

Israel's Supreme Court has made several such rulings in the past, ordering authorities to move the fence in several parts of the West Bank.

As word of the ruling got out, elated Bilin residents poured out of homes and schools and headed toward the fence. Gathering near several army jeeps, they chanted "We won," and "They demolished the Berlin wall, we want to demolish the Bilin wall."

Abdullah Abu Rahma, one of the leaders of the weekly protest, jubilantly honked the horn of his Honda jeep.

"We went to court, hired the best lawyers in Israel and we won," he said. Abu Rahma termed the ruling "wonderful," but said villagers would keep fighting until the fence was moved entirely off Bilin's land.

The Israeli Defense Ministry said in a statement that it would "study the ruling and respect it."

Israel began building the 425-mile barrier — a combination of concrete walls, fences, trenches and patrol roads — along the West Bank in 2002, saying it was a necessary weapon in its war against Palestinian suicide bombers. But the barrier juts into West Bank territory, provoking Palestinian claims that Israel is using security arguments to mask a land grab.