Israel began building the barrier more than a decade ago, in a largely-successful attempt to prevent Palestinian attacks inside Israel.
Palestinians charge that the barrier is mainly a land grab because much of it runs through the West Bank, often zig-zagging to include Jewish settlements and additional lands on what they believe will be the "Israeli side" of the barrier.
The barrier, as originally planned, would have run between the 19th-century Salesian Monastery and the Salesian Sisters' Convent and School. The Defense Ministry had proposed to route the barrier through the Cremisan Valley, leaving the Roman Catholic monastery on the Jerusalem side of the barrier and its sister convent on the West Bank side, as well as separating Palestinian landowners from their lands.
Israeli authorities had promised access between the monastery and convent, and for the Palestinians to their lands, through gates manned by soldiers.
The monastery, convent and Palestinian landowners in the area petitioned the court to change the planned route so the barrier would run closer to Jerusalem and keep the valley intact. Palestinian landowners presented their case to Pope Francis on his visit to the Holy Land last year. They said he promised to look into it.
The court Thursday ordered the Defense Ministry to offer an alternative route that poses less of a burden on the local Palestinian residents, as well as the monastery and convent. It set no timeframe, other than to advise that a new plan be submitted soon.
"In practical terms, the (court's) decision means that the separation wall (in the Cremisan Valley) will not be built as planned by the Israeli army," said the Society of St. Yves, a Catholic human rights group under the patronage of the Latin Patriarch of Jerusalem.
"The military will have to issue a new order for any future plans to build the wall in the area, whereby the local population can submit a new appeal," the organization, whose lawyers represented the convent in the case, said in a statement.
Also on Thursday, a Palestinian stabbed an Israeli soldier during an arrest of Palestinians who had sneaked past the separation barrier on their way into Israel, the military said. The soldier was stabbed in the West Bank alongside the barrier. He suffered light injuries and was evacuated to the hospital, the military said.
In a separate incident, Israel arrested a female Palestinian lawmaker from a left-wing militant group for disobeying an Israeli order barring her from the city of Ramallah.
The military said it arrested Khalida Jarrar, a senior political leader of the Popular Front for the Liberation of Palestine, early Thursday due to "substantial concerns about the safety and security of the region."
Last year, the military confined her movement to the city of Jericho and its surroundings. The army said the restraining order was based on her "incitement and involvement in terror." It gave no further details.
Her husband, Ghassan Jarrar, said she was arrested from their Ramallah home. She had long flaunted the Israeli ban. The military said it has not decided whether to press charges.
Reuters and the Associated Press contributed to this report.