Israeli Justice Minister Ayelet Shaked, right takes part in a Jewish Home party meeting in the Knesset in February. (Ronen Zvulun/Reuters)

Internationally known human rights organizations in Israel reacted with indignation Tuesday to a law passed by the Israeli parliament that singles out groups receiving the majority of their funding from foreign governments.

Leaders of the non-governmental organizations, who make up the core of Israel’s “peace camp” and are part of the dwindling left wing in Israel, said the law was written by Prime Minister Benjamin Netanyahu’s government to muzzle opposition to the almost 50-year military occupation of the West Bank.

Many of the 25 groups that would be affected by the new law are supported by European governments. The European Union is opposed to the Israeli occupation of the West Bank and wants to see a Palestinian state emerge from the conflict.

Proponents of the law, which was passed after a marathon debate in the Knesset, Israel’s parliament, on Monday night, say the goal is to bring more transparency for organizations funded by foreign states seen as meddling in Israeli affairs.

But the law is controversial because it mainly affects left-wing human rights organizations that are fighting for the Palestinian cause and are often critical of the government.

Israeli politicians, for example, have condemned Israeli groups such as Breaking the Silence as “traitors.” The organization is composed of current and former Israeli soldiers opposed to the occupation.

When Justice Minister Ayelet Shaked presented the bill several months ago, she cited Israeli human rights groups that contributed to an inquiry by the United Nations into Israel’s 2014 conflict with Hamas in the Gaza Strip. She said the U.N. report, which accused Israel of war crimes, was based on testimonies from Israeli NGOs including B’Tselem, Breaking the Silence and Adalah.

The new law does not cover the many right-wing, nationalistic or religious organizations in Israel receiving the majority of their funding from private donors and organizations overseas, such as Republican mega-donor and Las Vegas casino magnet Sheldon Adelson.

Sponsored by Shaked and backed by Netanyahu, the law requires NGOs receiving more than half of their funding from foreign governments to note that in reports to the registrar of nonprofit associations and in all official publications.

An earlier version of the bill called for NGO members to wear special badges while in the Knesset, but that provision was removed from the final bill.

“Imagine if Israel had funded British organizations and encouraged them to back the exit from the [European Union],” Shaked said during her presentation in the Knesset on Monday. “Britain has national honor. It would not have allowed Israel to meddle in its internal affairs.”

In a statement released after the bill was passed, Netanyahu said that it “prevents an absurd situation in which foreign countries interfere in Israel’s internal affairs by funding organizations without the Israeli public’s knowledge.”

He said that despite the criticism, it would actually increase transparency and strengthen Israel’s democracy.

The European Union said in a statement that the new legislation undermines Israel’s democratic values and goes beyond the legitimate need for transparency.

“This legislation targets organizations working for human rights and democracy, while allowing ­ultra-nationalist organizations to keep their sources of funding hidden despite their claim that the law increases ‘transparency,’ ” the New Israel Fund, a U.S.-based organization that works to advance liberal democracy in Israel, said in a statement.

The New Israel Fund’s chief executive, Daniel Sokatch, called the new law a “deeply anti- democratic move.”

“The only thing transparent about this law is its true purpose: to intimidate and silence the civic sphere and those advocating for an end to the occupation in particular,” he said.

Sari Bashi, a spokeswoman for Human Rights Watch, also said the law was worrisome.

“It targets and burdens human rights and left-wing groups by imposing onerous reporting requirements and hefty fines for noncompliance. If the Israeli government were truly concerned about transparency, it would require all NGOs to actively alert the public to their sources of funding — not just those that criticize the government’s policies,” she said.

In a statement, U.N. Secretary General Ban Ki-moon said the law “contributes to a climate in which the activities of human rights organizations are increasingly delegitimized.”

He also said that he is “deeply troubled by shrinking space for civil society in the region and around the world.”

Peace Now, an organization that advocates for a two-state solution to the Israeli-Palestinian conflict, said that it planned to challenge the law in Israel’s supreme court.

“The NGO bill is a blatant violation of freedom of expression,” the organization wrote in a statement. “It is tailored specifically to target only peace and human rights organizations, [and] its true intention is to divert the Israeli public discourse away from the occupation and to silence opposition to the government’s policies.”

The law will go into effect Jan. 1, and NGOs that violate the new rules will face a hefty fine.