JERUSALEM — An Israeli court issued an interim injunction on Wednesday temporarily preventing Israel’s Interior Ministry from deporting Omar Shakir, the Israel and Palestine director at Human Rights Watch.

Shakir, a U.S. citizen, had his work permit revoked this month based on a recent amendment to the country’s immigration laws aimed at fighting supporters of the boycott, divestment and sanctions (BDS) movement.

This is the first time that Israel is applying the law against a person already inside the country; in previous instances, BDS activists seeking to enter the country have been blocked. If Shakir is expelled, critics say, it places Israel in a highly undesirable group of nations that have banned human rights activists.

Attorneys for Shakir have challenged the ministry's decision in a legal petition and requested he be allowed to stay in the country pending the court case. That request was initially turned down by the Jerusalem District Court, but on Wednesday the same court reversed the decision, allowing him to remain.

“Denying entry to or, worse, deporting people from a country because they are or were in their past critical of its governmental policies is a classic feature of authoritarian regimes,” said Michael Sfard, Shakir’s attorney.

“Israel contends to be a liberal democracy, but Omar’s case clearly shows that the government is persecuting people on political grounds,” he said.

By his own admission, Shakir was once active in promoting boycotts against Israel but says he has not engaged in such activities since taking up his position with Human Rights Watch and being granted a work permit by Israel a year ago.

Shakir, a U.S. citizen, was initially denied permission to work in Israel, but in March 2017 the Interior Ministry relented and granted him a year-long visa. When he applied to renew that visa, however, he was told that his status was under review. On May 7, Shakir was notified that the permit had been revoked. He was ordered to leave Israel within 14 days.

“After a thorough investigation, it was found that in recent years, Mr. Shakir has worked consistently, prominently, and continuously to promote boycotts against the State of Israel and international companies investing in Israel,” said a statement from the Ministry of Strategic Affairs and Public Diplomacy, which has been tasked with combating the BDS movement.

The government says the boycott campaign actively promotes Israel’s demise and denies the country's basic right to exist as a Jewish and democratic state. Those who advocate BDS say their goal is to pressure Israel into complying with international law vis-a-vis its policies toward Palestinians. The movement discourages the purchase of Israeli goods, pressures international companies not to conduct business in Israel, and urges celebrities not to visit or perform in the country.

The ministry, which worked with the Interior Ministry to pass legislation banning BDS activists from entering Israel, pointed to Shakir’s contribution to a U.N. Human Rights Council report blacklisting international and Israeli companies operating in the occupied West Bank, as well as his role working with the Palestinian Authority to ban Israel from the international soccer association FIFA and his call for an investigation of Israel by the International Criminal Court.

“It is unacceptable that boycott promoters are allowed visas to stay in Israel, while at the same time attempting to harm the country,” Interior Minister Aryeh Deri said in a statement. “I will do everything in my ability to prevent such individuals from entering or residing in Israel.”

Gilad Erdan, minister for strategic affairs and public diplomacy, said: “Even when they attempt to hide their promotion of anti-Israel boycotts by appropriating the language of human rights, we will reveal their hypocrisy and moral double standards and hold them accountable for their actions.”

Both ministers dismissed suggestions that not renewing Shakir’s visa would generate international criticism. A dossier prepared by Erdan’s ministry on Shakir’s case said, “Our view is that it is untenable to allow a person who has been consistently involved in activities intended to harm the State of Israel over many years to work in the country as if nothing has happened.”

Human Rights Watch said most of the information contained in the dossier was based on Shakir’s activities “predating his Human Rights Watch employment.”

The group also noted that when Shakir’s work permit was initially denied, the Interior Ministry based its rejection on an advisory from the Foreign Ministry, which noted that “for some time now, this organization’s public activities and reports have engaged in politics in the service of Palestinian propaganda, while falsely raising the banner of ­‘human rights.’ ”

“This is not about Shakir, but rather about muzzling Human Rights Watch and shutting down criticism of Israel’s rights record,” said Iain Levine, deputy executive director for program at Human Rights Watch. “Compiling dossiers on and deporting human rights defenders is a page out of the Russian or Egyptian security services’ playbook.”

On Tuesday, the European Union called on Israel to reverse its decision on Shakir.

“Otherwise Israel will join a very short list of countries which have barred entry to, or expelled, Human Rights Watch staff,” it said in a statement.

A consortium of 15 human rights organizations in Israel also slammed the decision, saying “the decision to deport a Human Rights Watch official, and the growing list of people to whom it denies entry for criticizing the occupation, places Israel squarely on a list of disreputable states.”

This post has been updated to reflect the court decision.