Government Files Testimony in Response to a Legal Challenge by Privacy-Advocacy Groups

LONDON—The British government said it can justify mass surveillance of U.K. residents' online searches and electronic communications over Internet services including Google Inc., Facebook Inc. and Twitter Inc., according to testimony disclosed on Tuesday as part of a legal complaint made by several privacy-advocacy organizations.

U.K. authorities didn't confirm they conduct that type of mass spying on residents. But they said...