The publishers of Wikipedia and several rights groups became the latest plaintiffs to challenge the National Security Agency's surveillance programs in court, alleging that the Fort Meade-based organization conducts "mass Internet spying" on Americans' international emails and other online activity.

The Wikimedia Foundation, Amnesty International USA, the conservative Rutherford Institute and other plaintiffs allege that the NSA's "Upstream" surveillance program violates privacy rights under the Fourth Amendment and infringes on First Amendment freedom-of-speech guarantees. They are being represented by the American Civil Liberties Union.

The lawsuit feeds into the roiling debate started by revelations about the NSA's spying programs by former agency contractor Edward Snowden — whose mother works at the federal court in Baltimore where it was filed. It pits advocates for online privacy and freedom of expression against the government spy agencies that trawl the Internet for terrorists and other adversaries.

ACLU attorney Patrick Toomey said the collection of online data "constitutes a massive invasion of privacy."

"Ordinary Americans shouldn't have to worry that the government is looking over their shoulders when they use the Internet," he said.

But a review by the Privacy and Civil Liberties Oversight Board, an internal government watchdog, concluded that while some aspects of the program raised privacy concerns, overall "the information the program collects has been valuable and effective in protecting the nation's security."

Officials have acknowledged the existence of the Internet data collection program and have pledged to make tweaks to better protect the privacy of Americans and innocent foreigners. But much about how it works remains secret.

The plaintiffs alleged that the NSA intercepts, copies and searches through Internet traffic using keywords called selectors that are associated with its targets.

The surveillance is conducted under the FISA Amendments Act of 2008, which allows the NSA to target the communications of foreigners abroad. But the plaintiffs say the agency exceeds the scope of that law with what amounts to unconstitutional warrantless review of private emails and online activities.

The plaintiffs say that the risk of having their Internet communications scooped up has caused problems for the plaintiffs, which also include Human Rights Watch, The Nation magazine, and the National Association of Criminal Defense Lawyers.

The Wikimedia Foundation says it worries that foreign users will stop contributing to Wikipedia because they cannot be sure their communications won't be intercepted.

"By tapping the backbone of the Internet, the NSA is straining the backbone of democracy," said Lila Tretikov, executive director of the Wikimedia Foundation. "By violating our users' privacy, the NSA is threatening the intellectual freedom that is a central to people's ability to create and understand knowledge."

So far, lawsuits challenging the NSA have had limited success. Several cases attacking the agency's collection of telephone call logs are before federal appeals courts, but only in one did a court rule that the program was unconstitutional.

Last month, a federal judge in California threw out a case challenging the Internet data collection, concluding in an unusual opinion that classified documents filed in that case showed that "the plaintiffs' version of the significant operational details of the Upstream collection process is substantially inaccurate."

The judge wrote that he regretted not being able to describe why the description was inaccurate, but said disclosing further details about the program would harm national security.

Andrew Crocker, an attorney with the Electronic Frontier Foundation who was involved in the California case, said the judge's ruling was a "head-scratcher" and that the group is exploring its options.

"We think that our description of how Upstream works is substantially accurate," he said. "We have our doubts as to how they would be contradicting our picture of things."

In 2013, the U.S. Supreme Court ended an ACLU challenge to the NSA's secret wiretapping of international phone calls and emails, ruling that the plaintiffs could not prove they had been spied on.

But Ashley Gorski, an ACLU attorney involved in the Wikipedia case, said the Snowden disclosures should provide a way around that problem, because more information about how the surveillance programs work is publicly available.

Given how much about the program has been revealed, Gorski said, it will now be difficult for the government to claim "with a straight face" that it is a state secret.

While activists have taken to the courts to seek changes to the NSA's programs, there is also the prospect of congressional action. The law authorizing the phone data collection is due to expire in June. If the program is not reauthorized, intelligence officials have said, it will end.

Legislation that would have stopped the government from holding the call data but would have allowed authorities to get it from phone companies failed to advance in the Senate late last year. Lawmakers are expected to take the issue up before the existing law expires.

Internet users are also doing more to take their privacy into their own hands, using services that allow them to encrypt their communications, making them more resistant to government intrusions. Such tools were once the exclusive domain of experts, but easier to use programs — including an iPhone app to encrypt text messages — have become widespread.

Crocker said it makes sense for Internet users concerned about privacy to adopt encryption, with one important caveat.

"We only know some fraction of what the NSA is doing," he said. "It would be a mistake to say this is a foolproof solution."