On Monday, just hours after President Trump issued his revised executive order on immigration, lawmakers in Israel passed a travel ban that is also generating controversy. The new law aims to bar any foreign activist “who has knowingly issued a public call to boycott the state of Israel or pledged to take part in such a boycott” from entering the country.

Among its many confusing components, “it is not entirely clear what constitutes a public call, or how the ban will be enforced,” as my colleague Yasmeen Serhan noted earlier. However, the law will apply to those who boycott Israel and its institutions (but who may still want to visit Israel to protest or organize efforts against the country) as well as those who boycott Israeli settlements, which have long drawn international censure. Essentially, the ban formalizes an improvised policy whereby Israel’s interior ministry has blocked the entry of some pro-Palestinian activists into Israel in the past.

Despite being quite different in letter, the spirit of the new Israeli measure quickly drew comparisons to the American president’s executive order. “On the same day President Trump signed a new racist, Islamophobic executive order, the Knesset has shown that it, too, will make it a matter of law and policy to use discriminatory tests to decide who may enter Israel,” Daniel Sokatch, the head of the New Israel Fund, an American organization that donates to progressive causes in Israel, told The Washington Post. A spokesman for Bezalel Smotrich, an Israeli legislator who supported the law, previously alluded to the American travel ban, saying, “[W]ithout going into the policies of the [U.S.] president, every sovereign nation must set its policies in accordance with what is good for it.”

Both the new Israeli and American measures also contain vague, ideological components. It was on the campaign trail last August that candidate Trump first proposed “extreme vetting,” a (problematically subjective) method of further gauging if potential immigrants to the United States “have hostile attitudes toward our country” or “believe in our Constitution.” The president’s new travel ban is a policy extension of extreme vetting.

Meanwhile, for Israel, denying foreign visitors entry to the country based on their political views could be interpreted as a form of extreme vetting against forces it has previously labeled a national threat. In 2016, Israel allocated $32 million to combat the BDS (Boycott, Divest, and Sanctions) Movement, which it contends is seeking to delegitimize the country and whose members are a clear target of the ban. The logic of the Israeli law, according to its defenders, is that it is “patriotic” and, in the words of Naftali Bennett, who leads the pro-settlement Jewish Home party, it allows Israel to defend itself against those “who wish it harm.”

However, the law may introduce more problems than it eliminates. While some in the BDS Movement call for the destruction of Israel, there are activists both inside and particularly outside the movement, along with politicians around the world and a plurality of American Jews, who oppose Israeli settlements specifically. Though the new Israeli law only directly targets supporters of boycotts, linking opponents of Israeli settlements and opponents of the State of Israel itself seems likely to isolate Israel’s allies. Haaretz, the Israeli paper, also reported that the ban does not include an exemption for some Palestinians who live inside of Israel without citizenship, an exemption that had been urged by the the country’s Justice Ministry.

What the U.S. immigration ban and the new Israeli law perhaps most potently share is that they have been cited by opponents as proof that each country is on a path toward illiberalism. “This bill is the latest piece of Israeli legislation to undermine Israel’s own democratic principles and its international standing,” J Street, the liberal pro-Israel advocacy group, tweeted on Tuesday. The American Jewish Committee, which vehemently opposes the BDS Movement, called the Israeli measure “troubling.” Criticisms of the law also came from within Israel, where it was characterized by one civil-rights organization as “blatantly anti-democratic.” Ironically, Israelis (and even travelers with an Israeli stamp on their passports) have often been barred entry from a handful of countries including Sudan, Yemen, Syria, and Iran, which the U.S. banned on Monday.