The UK government’s power to keep local authority pension investments in line with national foreign and defence policy has been quashed.

A High Court judge ruled last week that the guidance, announced only last year, had been used unlawfully.

The guidelines related to procurement and required local government pension schemes (LGPS) to have a policy on environmental, social, and governance issues. However, it also affected some schemes’ decisions to divest from certain companies.

The Palestine Solidarity Campaign, which brought the case, said the power was introduced “specifically to curtail divestment campaigns against Israeli and international firms implicated in Israel’s violations of international law, as well as to protect the UK defence industry”.

Unison, the biggest trade union in the public sector, said it was “preposterous that local government funds had to invest in the best interests of UK foreign and defence policy”.

Several European pension investors – including Norway’s Government Pension Fund Global and the Dutch healthcare scheme’s asset manager, PGGM – have divested from specific Israeli companies in recent years because of concerns about the treatment of Palestinians in contested territories in the Middle East.

Conversely, some authorities have introduced anti-boycott legislation. In 2015, the US state of Illinois put a legal block on five state pension funds’ ability to invest or maintain holdings in companies that directly or indirectly boycotted Israel.

The UK ruling would not prevent government from intervening in how local authority pensions are invested. Ralph McClelland, a lawyer at Sackers, said funds “should only take a non-financial factor into account if they are satisfied that this view is shared by the membership and ratepayers and if they can do so without significant financial detriment to the fund”.

Unison, however, wants the government to go further and make the £217bn LGPS system subject to the EU’s IORP directive. This would require schemes to analyse their portfolios in depth to assess their exposure to carbon-intensive assets.

John Hanratty, head of pensions in the north at law firm CMS, described it as “anathema” that the biggest funded pension scheme in the country was not subject to the same regulations as private-sector schemes. “The 2016 regulations were apparently motivated in part by political interests, which is unsettling,” he said.

The government may yet appeal the ruling or rewrite its guidance.