SAN FRANCISCO – Nineteen organizations ranging from a church to gun rights groups sued the National Security Agency in federal court in San Francisco today to challenge the mass collection of their telephone records.

The groups contend the data collection violates the constitutional First Amendment right of association because it could chill or inhibit their members from joining together and expressing political views.

Cindy Cohn, an Electronic Frontier Foundation lawyer representing the plaintiffs, said, “The NSA’s mass, untargeted collection of Americans’ phone records violates that right by giving the government a dramatically detailed picture into our associational ties.”

As an example of the program, the lawsuit includes copies of a secret court order disclosed by the Guardian newspaper on June 5, as well as a June 6 statement by National Intelligence Director James Clapper acknowledging a “broad in scope” program to collect so-called metadata such as telephone numbers dialed and length of calls.

The top-secret Foreign Intelligence Surveillance Court order, which the Guardian said was obtained by former NSA contractor Edward Snowden, required Verizon to provide copies of records of all calls made either within the United States or between United States and abroad between April 25 and July 19.

Cohn said the order and Clapper’s statement will help the plaintiffs get over the legal hurdle of trying to show that their records were collected.

“The government has now admitted a program of collecting phone records in bulk and keeping them for at least five years. I think we have a very strong challenge here,” she said.

The San Francisco-based EFF is also representing five California citizens in a 2008 lawsuit that accuses the NSA of engaging in unconstitutional dragnet surveillance.

That lawsuit was based on a statement in which a former AT&T technician, Mark Klein, alleged he had seen fiber optic cables routing communications records into a secure room controlled by the NSA at an AT&T facility in San Francisco in 2003.

Last week, U.S. District Judge Jeffrey White in San Francisco rejected a government bid for dismissal of the earlier lawsuit and said he will ask both sides to file briefs on the impact of “recent events involving the public disclosure of relevant, and previously classified, information.”

The EFF lawyers have asked the federal court to assign the new lawsuit to White as well for purposes of judicial efficiency.

The lead plaintiff in the new lawsuit is the First Unitarian Church of Los Angeles.

Its minister, the Rev. Rick Hoyt, said the 136-year-old church has a history of advocating social justice and doesn’t want its members and neighbors to fear participating because of the surveillance.

“This spying makes people afraid to be part of our church community,” he said.

Other plaintiffs include the Calguns Foundation, the California Association of Federal Firearms Licensees, the Council on American Islamic Relations of California, Greenpeace, the National Organization for the Reform of Marijuana Laws and the Unitarian Universalist Service Committee.

In addition to claiming a violation of the right of association, the lawsuit contends the records program violates the Fourth Amendment ban on unreasonable searches and the Fifth Amendment guarantee of due process of law.

It claims the data collection exceeds the authority of a federal law that allows the FISA court to approve the collection of tangible business records for an investigation to obtain foreign intelligence information or protect against terrorism activities.

The lawsuit asks for court orders prohibiting continuation of the program and requiring the destruction of information collected.

A Justice Department spokesman could not be reached for comment on Tuesday afternoon.