With hopes for a two-state solution between Israel and the Palestinians vastly diminished, Palestinians and their supporters have been advocating a strategy called B.D.S.: boycott, divestment and sanctions. The movement has been most active in Europe and the United States, and supporters have compared it to the campaign against apartheid in South Africa — an analogy fiercely disputed by defenders of Israel.

Academic groups, artists, churches and companies from many countries are boycotting or divesting from Israel, or from the occupied territories in the West Bank. The Israeli government and other critics say the boycott movement is anti-Semitic and aims to undermine Israel’s right to exist.

Bezalel Smotrich, a member of the Knesset who is a co-sponsor of the bill to bar entry to boycott supporters, said: “We will now stop turning the other cheek. Preventing B.D.S. supporters who come here to hurt us from the inside is the very least we should be doing against haters of Israel.”

Dov Hanin, who voted against the legislation, said that at a time when boycotts against settlements are being promoted around the world, the law “is really a law to boycott the world.”

“A country that boycotts the world is basically isolating and boycotting itself,” he continued.

Israel has already turned away some travelers for political reasons. Last December, Isabel Phiri, a theologian and an assistant general secretary of the World Council of Churches in Geneva, was refused entry after landing in Tel Aviv with a tourist visa. Last July, five Americans on a fact-finding trip were detained, questioned and deported, with Israeli officials citing security reasons.