LONDON — The court that oversees Britain’s intelligence agencies ruled Friday that electronic mass surveillance of people’s cellphone and online communications, like the Prism program revealed by Edward J. Snowden, is legal.

The ruling, on a complaint brought by privacy advocates and rights groups like Amnesty International, is one of the first by a high-level court in any case linked to revelations by Mr. Snowden, the former intelligence contractor. But it is unlikely to end the debate over whether intelligence agencies should have access to online communications.

The decision came after a global outcry against surveillance programs like Prism, which give American and British intelligence agencies almost unfettered access to Internet communications without individuals’ knowledge.

The privacy groups said they would appeal the British court’s decision at the European Court of Human Rights, which would move the deliberations to the Continent, where citizens’ digital privacy rights are generally afforded higher protection than in Britain.