The Knesset passed into law on Monday a bill barring supporters of a boycott on Israel from entering the country.

The legislation, advanced by right-wing and centrist coalition lawmakers, prevents foreign nationals who have publicly called for a boycott of the Jewish state or work on behalf of an organization that advocates these measures from entering Israel.

The legislation passed its third and final reading with 46 lawmakers voting in favor and 28 voting against it.

It was not immediately clear when the ban would take effect.

The law also extends to supporters of boycotts of West Bank settlement products, resting on a legal definition of an Israel boycott in a 2011 law that includes all “areas under its control.”

It would not apply to foreign nationals who have a residency permit and gives the interior minister leeway to make exceptions. Under the existing law, the interior minister already has the right to bar individuals from entering Israel.

An Israeli airport security guard patrols with a dog in Ben Gurion airport near Tel Aviv, Israel, Tuesday, March 22, 2016. (AP Photo/Ariel Schalit)

An Israeli airport security guard patrols with a dog in Ben Gurion airport near Tel Aviv, Israel, Tuesday, March 22, 2016. (AP Photo/Ariel Schalit)

The bill was approved in its first reading in November and the second and third readings of the bill were originally scheduled for late January, but were put off until Monday.

MK Roy Folkman (Kulanu), who sponsored the bill, said the legislation was necessary in order to protect Israel’s “name and honor.”

Kulanu MK Roy Folkman seen during a faction meeting on July 11, 2016. (Miriam Alster/Flash90)

Kulanu MK Roy Folkman seen during a faction meeting on July 11, 2016. (Miriam Alster/Flash90)

“It is possible to feel both national pride and also to believe in human rights. It is also possible to defend the name and honor of the State of Israel and this is no embarrassment,” he said, according to a Knesset spokesperson.

MK Bezalel Smotrich (Jewish Home), who helped spearhead the bill, said the new law shows that Israel “won’t turn the other cheek” and that it was a “natural” step for any country to take.

A spokesperson for Smotrich previously compared the legislation to US President Donald Trump’s controversial travel ban, saying “without going into the policies of the [US] president, every sovereign nation must set its policies in accordance with what is good for it.”

Critics of the bill have charged that it silences legitimate political dissent on Israeli policy.

Joint (Arab) List head Ayman Odeh said by banning settlement boycott supporters, the bill would end up ensnaring hundreds of Jews in the US and elsewhere who “are not against the country, but against the occupation.”

MK Dov Khenin of the Joint List charged that the bill would helping the boycott against Israel by antagonizing critics of the country’s policies and in doing so “isolate itself.”

Israel in December for the first time refused entry to a supporter of the Boycott, Divestment and Sanctions (BDS) campaign. Isabel Piri, from Malawi, arrived at Ben Gurion International Airport as a tourist, but was refused entry as information available to immigration control showed Piri was active in the World Council of Churches, which supports boycotting products from West Bank settlements.

Last week, Israel prevented Human Rights Watch Israel and Palestine Director Omar Shakir from entering the country for the second time in less than a month due to his past pro-BDS activism, but on Monday he was allowed into the country.