The International Court of Justice in The Hague ruled Friday that the security barrier being constructed by Israel in the West Bank is illegal, violates the human rights of Palestinians and must be dismantled.

In a nonbinding advisory opinion, the court rejected Israel's contention that the barrier was essential for its security. It ruled that Palestinians whose land has been confiscated for the 450-mile barrier should be compensated and called on countries not to help Israel build the fence.

"Israel is under an obligation to cease forthwith the works of construction of the wall being built in the Occupied Palestinian Territory, including in and around East Jerusalem, to dismantle forthwith the structure therein situated," the court said.

The Palestinian leader, Yasser Arafat, called the ruling "a victory for the Palestinian people, adding, "We salute this decision condemning the racist wall."

Israel's deputy prime minister, Ehud Olmert, said the fence would not be removed. "It's certainly unpleasant to have the ruling, but it's more unpleasant to have suicide attacks from territories not defended by the fence," he said. "The fence is probably uncomfortable and inconvenient for the Palestinians who live alongside of it, but it doesn't kill. The fence is removable and reversible, and death is not."

The court ruled 14 to 1 against the fence, with the American judge, Thomas Buergenthal, siding with Israel. On a separate question -- whether countries should withhold aid and support for the barrier project -- the court was split 13 to 2. A Dutch judge, Pieter H. Kooijmans, joined Buergenthal in dissenting from the majority view, which called on countries "not to render aid or assistance in maintaining the situation created" by the wall.

Palestinian legal advisers said they would seek clarification on what the judges meant by "aid or assistance" and whether the ruling amounted to a call for sanctions against Israel.

Although the ruling, which was requested by the U.N. General Assembly, is nonbinding, the court's opinions carry moral and political weight. Past decisions have been used to pressure governments in the court of public opinion, such as a ruling in 1971 against South Africa's occupation of Namibia, which led to Namibia's independence and fueled an economic boycott against South Africa's white-minority government.

Israeli officials have argued that the fence is necessary to prevent Palestinian suicide bombers from entering Israel from the West Bank, and they point to the dramatic drop in suicide attacks in the 18 months that the wall has been under construction. Israeli Prime Minister Ariel Sharon, who first conceived of the wall, has called it a temporary solution to Palestinian attacks.

But Palestinians have denounced the barrier, which cuts deep into West Bank territory to encompass Jewish settlements, as an attempt by Israel to grab Palestinian land. Palestinians also say the construction project has hindered attempts to negotiate a solution to the long-running Israeli-Palestinian dispute.

The barrier project, which is projected to cost $1.7 billion, is actually a series of barbed wire and electronic fences, ditches and huge concrete slabs in some places. About 120 of its 447 miles have been built.

The Israeli Supreme Court ruled last week that a portion of the barrier had to be rerouted because it was causing undue hardship to Palestinians by cutting them off from their farms, schools and hospitals. Although that decision concerned only one small section of the wall north of Jerusalem, it established the principle that Israeli security needs had to be balanced against the suffering caused to Palestinians.

The International Court said in its ruling, however, that it was "not convinced that the specific course Israel has chosen for the wall was necessary to attain its security objectives."

"The wall, along its route chosen, gravely infringes a number of rights of Palestinians residing in the territory occupied by Israel, and the infringements resulting from that route cannot be justified by military exigencies or by the requirements of national security or public order," the court said.

Michael Tarazi, a legal adviser to the Palestine Liberation Organization, called the ruling "a legal slam dunk for the Palestinians" and said he hoped it would "serve as a basis for new policies by the international community, which is called upon to actively resist Israeli violations."

But Gideon Meir, a senior Israeli Foreign Ministry official, said: "The court decided to neglect the issue of terrorism, so how can we take it seriously? If there was no terror, we wouldn't need the fence."

The decision by the court, also known as the World Court, will now go to the U.N. General Assembly, where Palestinian and other Arab diplomats are expected to press for a resolution ordering Israel to comply with the ruling or face international sanctions. The issue could end up before the Security Council, where the United States is expected to use its veto to forestall any attempt to impose sanctions.

Ahmad Jafal, 32, a Palestinian attorney who lives in Abu Dis, a town just east of Jerusalem that has been split by a section of the wall, welcomed the ruling.

"I am very happy today," said Jafal, who teaches law at Al-Quds Open University. "Even if this court ruling is not implemented, morally it is very important. It encourages the Palestinian nonviolent struggle against the wall."

Yossi Mendelevitch, an Israeli whose 13-year-old son, Yuval, was killed in a suicide bombing in Haifa in 2003, said, "No doubt the fence would have stopped this malicious murder, no doubt the fence has already stopped other attacks."

Mendelevitch criticized the court in The Hague as "biased" but said Israel should work to reroute the barrier, in line with the Israeli high court decision.

Correspondent John Ward Anderson and special correspondent Samuel Sockol in Jerusalem contributed to this report.

About 120 miles of the planned 447-mile barrier have been built, but the court ruled that it violates Palestinians' human rights and must come down.