JERUSALEM — Israel's Supreme Court on Tuesday rejected the appeal of the local director of Human Rights Watch to block the Israeli government's attempt to expel him for allegedly supporting an international boycott movement against Israel.

The court said it did not find sufficient evidence to overturn a lower court's ruling that upheld a government decision not to renew Omar Shakir's work visa, saying the decision fell within the purview of the interior minister.

His initial order was for Shakir to leave the country because his advocacy against Israel's settlements in the occupied West Bank amounted to support for the Palestinian-led boycott movement. An Israeli law from 2017 bars entry to those who publicly support a boycott of Israel or its West Bank settlements.

Shakir's case has been followed closely internationally as a litmus test for how Israel would enforce the controversial legislation. While one of the three judges said Shakir's public statements were a clear call for boycott, the majority of the 10,000-word ruling, written by Justice Neal Hendel, focused on the legality of the decision rather than the law itself.

"There is nothing in the decision to reflect upon other human rights organizations and activists," Hendel wrote. The court gave Shakir 20 days to leave the country and ordered him to pay the legal fees associated with the case.

Human Rights Watch says neither it nor Shakir has called for an outright boycott of Israel and says that Shakir, who is a U.S. citizen, is being targeted for the rights group's opposition to Israel's West Bank Jewish settlements and its calls for companies to stop working with the settlements.

Israel captured the West Bank, along with east Jerusalem and the Gaza Strip, from Jordan in the 1967 Mideast war. Palestinians seek these territories for a future state. Most of the international community considers Israeli settlements in the West Bank illegal.

In an initial response, Shakir tweeted that if the Israeli government insisted upon his deportation it "would join the ranks" of Iran, North Korea and Egypt in blocking access of Human Rights Watch officials.

Israel has adopted a tough stance in recent years toward the Palestinian-led Boycott, Divestment and Sanctions movement, which it says is aimed at delegitimizing Israel's existence and wiping it off the map. The BDS movement presents itself as a non-violent campaign for Palestinian rights and says it does not endorse a specific solution to the conflict.

Maurice Hirsch, a lawyer for the pro-Israel NGO monitor group that joined the case against Shakir, said it had presented evidence going back to 2010 of Shakir publicly supporting BDS. Shakir took up his position with Human Rights Watch in 2016.

Hirsch said the ruling requiring Shakir to leave Israel was "an important expression of Israeli democracy."

"The court confirms that, while in Israel, Shakir spent his time unjustifiably vilifying Israel and promoting Boycott, Divestment and Sanctions activities," he said. "Despite his claims, Shakir's work had very little, if anything, to do with protecting human rights."

Tuesday's decision had been delayed for months as Shakir and his backers made their case against his deportation. The court allowed him to stay in Israel for the duration of the proceedings.