British spy agencies are under scrutiny in a landmark court case challenging the legality of top-secret mass surveillance programs revealed in documents leaked by whistleblower Edward Snowden.

A panel of 10 judges at the European Court of Human Rights in Strasbourg, France, held a hearing Tuesday to examine the U.K. government’s large-scale electronic spying operations, following three separate challenges brought by a dozen human rights groups, including Amnesty International, Privacy International, the American Civil Liberties Union, Big Brother Watch, the Open Rights Group, and the Irish Council for Civil Liberties.

The case is the first of its kind to be heard by the court, which handles complaints related to violations of the European Convention on Human Rights, an international treaty by which the U.K. is still bound despite its vote last year to leave the European Union. The court’s judgments could have ramifications for future U.K. surveillance operations.

The human rights groups are arguing that British spy programs violate four key rights protected under the convention: the right to privacy; the right to a fair trial; the right to freedom of expression; and the right not to be discriminated against. They cite a 2015 ruling by a U.K. tribunal, which found that British eavesdropping agency Government Communications Headquarters, or GCHQ, had unlawfully spied on the communications of Amnesty International and the South Africa-based Legal Resources Centre.

Dinah Rose, a lawyer representing the human rights groups, acknowledged in court Tuesday that some serious security threats require the use of covert government surveillance. But, she added, “excessive and unaccountable state surveillance puts at risk the very core values of the free and democratic societies that terrorism seeks to undermine.”

The British government has insisted that it does not carry out “mass surveillance,” preferring instead to use the term “bulk surveillance,” which it says is necessary to discover previously unknown threats. Documents leaked by Snowden describe how GCHQ planned to carry out “population scale” surveillance; boasted that it had “massive access” to internet communications; and monitored more than 50 billion “events” about communications each day.

Government lawyer James Eadie told the court that using surveillance systems to collect and store communications is not itself a violation of privacy. Instead, he said, privacy is only violated when there is “sentient examination” of communications – in other words, when a human analyst reads or listens to individual messages or calls. This will be a key point of contention for the Strasbourg judges to consider.

Last year, a complaint filed in the case by 10 of the human rights groups named more than a dozen surveillance programs that allegedly violate rights and do not have adequate safeguards against abuse. Among them are GCHQ programs, such as KARMA POLICE, which was first exposed by The Intercept. KARMA POLICE was designed to allow the GCHQ to build “a web-browsing profile for every visible user on the internet.” The complaint also focuses on NSA-operated programs that have been shared with British spies, such as XKEYSCORE, a tool that can be used to sift through masses of emails, online chats, and virtually every other kind of internet data.

Nick Williams, Amnesty International’s senior legal counsel, said in an email that the case represented a “watershed moment for people’s privacy and freedom of expression” across the world. “The case concerns the U.K., but its significance is global. By bringing together human rights defenders and journalists from four different continents, it serves to highlight the dangers mass surveillance poses to the vital work of countless organisations and to individuals who expose human rights abuses and defend those at risk.”

Scarlet Kim, a legal officer with Privacy International, said in a statement: “For years, the U.K. Government has been intercepting the private communications and data of millions of people around the world. At the same time, it can access similarly enormous troves of information intercepted by the U.S. Government. These practices are unlawful and violate the fundamental rights of individuals across the world, assailing privacy and chilling thought and speech.”

A spokesperson for the U.K. government’s Home Office declined to comment on the specifics of the case, but said in a statement that British intelligence agencies “conduct their vital work within a strict legal and policy framework that applies rigorous safeguards and oversight mechanisms to ensure respect for human rights. We will vigorously defend the powers our agencies need to keep us all safe and secure.”

Top photo: City workers use smartphones inside in London on Oct. 30, 2017.