A train track running along the 1949 armistice line is seen near terraced agricultural fields in Battir village, south of Jerusalem, Dec. 12, 2012. (AMMAR AWAD/REUTERS)

The old stone-walled farming terraces of this scenic Palestinian village near Jerusalem stretch along the hillsides, fed by spring water flowing through a network of irrigation channels that dates to Roman times.

Perched above a valley on the boundary with Israel, this community of 6,000 has become the focal point of a struggle pitting villagers and environmental advocates against the planners of Israel’s separation barrier in the West Bank, a complex of fences and walls built to keep out Palestinian attackers.

At Battir, the planned barrier route — including 500 yards of concrete wall — would cut through the valley, scarring a rare surviving landscape of naturally irrigated terrace agriculture dating back thousands of years. It would also separate villagers from about one-third of their cultivated lands, which would fall on the other side of the barrier.

This month, in response to petitions by villagers and the environmental group Friends of the Earth Middle East, Israel’s Supreme Court gave the Israeli defense ministry 90 days to come up with an alternative to the planned wall that would take into account “the unique character of the area” around Battir.

In its ruling — a rare intervention by the Supreme Court in the barrier project — the court urged security officials to reconsider “the nature of the divider and security arrangements” in the sensitive zone, which is a candidate for designation as a UNESCO World Heritage Site.

Israel’s Nature and Parks Authority, a government body, sided with the petitioners in court, saying the barrier would create “a wound in the ancient landscape” and “cut the farmers off from their lands, leading to the destruction of the ancient farming culture.”

Similar views were voiced by Israeli conservation experts, who argued that the planned barrier route would damage a unique landscape where spring-fed water canals lead to plots of vegetables and lemon trees.

“We’re not against a security barrier in principle, but we’re against building it in a cultural landscape site that requires protection,” said Gidon Bromberg, Israeli director of Friends of the Earth Middle East. “Building it in this particular location would contravene Israel’s own obligations as a signatory to the UNESCO World Heritage Convention.”

The defense ministry argued that completing the barrier in the Battir area would close a gap south of Jerusalem, protecting the city from possible terrorist attacks and shielding train tracks running on the Israeli side of the boundary. The ministry said steps had been taken to minimize the project’s impact on the farming terraces around the village.

The court’s ruling could compel defense officials to consider other means to monitor the area, such as surveillance cameras and patrols, both of which are already in use to protect the train.

Should the barrier project be suspended at Battir, it would not be the first time that a special security regime was put in place near the village.

Under the armistice agreement signed in 1949 after Israel’s war of independence, the farmers of Battir, in what was then the Jordanian-controlled West Bank, were allowed to continue cultivating village land that remained on the Israeli side of the cease-fire line. In return, they committed not to harm the Israeli train route between Jerusalem and Tel Aviv that runs along the boundary by their village.

The agreement has stood for decades, marred only by isolated instances of stone-throwing, mostly during the first Palestinian uprising that erupted in the late 1980s.

Akram Bader, the mayor of Battir, said that several years ago, students at the local school, which lies next to the tracks, rode the train to Jerusalem by special arrangement with the Israeli railroad company. “We teach them that the train is a friend, not an enemy,” he said.

“We take care of the border because we know we will be safe if Israel has security,” Bader added. “We can do that without any physical barrier. Battir is a special case, and that’s how it should be in the future, a pilot project of peace.”

Aware of the tourist potential in the village, local activists are upgrading walking trails and restoring stone terraces in the surrounding hills as part of the Battir Landscape Ecomuseum. Old houses in the village have been refurbished, and a guest house is set to open in the coming months.

“Our problem is the geopolitical situation,” said Hassan Muamer, a civil engineer directing the preservation work. He said he hoped the Supreme Court ruling would lead to the cancellation of plans to build any barrier, even a fence, in the valley below.

“We don’t need a new crime that would destroy the cultural heritage and peace in this area,” he said. “This was a win for us . . . for the moment.”