An Israeli court on Thursday ordered closed-door hearings in Amnesty International's legal bid to stop NSO Group from exporting surveillance software, which rights groups say is used to spy on journalists and dissidents worldwide.

A Tel Aviv District Court judge cited national security concerns when she banned the public and the media from court sessions. The move drew quick condemnation from the campaign group.

More:

"It's outrageous we have to be gagged," Gil Naveh, an Amnesty spokesman, told reporters.

Israel's defence ministry - which asked for the court restrictions - and NSO declined to comment on Amnesty's lawsuit. The case could decide whether the government needs tougher oversight on cyber-exports - a sector in which Israel is a world leader.

Amnesty says governments have used the Israeli company's mobile-phone hacking software, Pegasus, to crack down on activists across the world. A study by the University of Toronto's Citizen Lab has linked Pegasus to political surveillance in Mexico, the UAE, and Saudi Arabia.

NSO has said it only sells its technology to state and law enforcement agencies "to help them fight terrorism and serious crime".

Judge Rachel Barkai initially had said she would allow Amnesty's arguments to be heard publicly, but government lawyers argued it would then look as if the state was admitting to Amnesty's accusations and Barkai changed her mind.

NSO came under particular scrutiny when a Saudi dissident close to murdered journalist Jamal Khashoggi filed a lawsuit alleging that NSO had helped the royal court to take over his smartphone and spy on his communications with Khashoggi.

NSO has denied that its technology was used in Khashoggi's murder.

In October, WhatsApp, which is owned by Facebook Inc, sued NSO in the United States federal court in San Francisco. WhatsApp accused NSO of helping government spies break into the phones of about 1,400 users across four continents.

In Amnesty's case, brought by members and supporters of its Israel office, the organisation said NSO continues to profit from its spyware being used to commit abuses against activists across the world and the Israeli government has "stood by and watched it happen".

"The best way to stop NSO's powerful spyware products reaching repressive governments is to revoke the company's export licence, and that is exactly what this legal case seeks to do," said Danna Ingleton, deputy director of Amnesty Tech.

Amnesty Tech is described on Amnesty International's website as a global collective of advocates, hackers, researchers and technologies challenging "the systematic threat to our rights" by surveillance-based businesses.

NSO, which was purchased by London-based private equity firm Novalpina Capital last year, announced in September it would begin abiding by UN guidelines on human rights abuses.