The Department of Justice will release hundreds of pages of documents covering the legal reasoning behind the government's collection of virtually every American's phone call data. The impending release over the next several days, which will include a secret court opinion authorizing the program, is the result of a 2-year-old lawsuit filed by the Electronic Frontier Foundation, a San Francisco-based digital rights group.

Since former NSA contractor Edward Snowden leaked information on the massive phone data program, privacy rights and civil liberties groups have questioned its legality. The government has provided some justification for its legality, but these advocates and legal experts have found it wanting. Now, thanks to the lawsuit, and aided by Snowden's revelations, the government will release the secret court opinions justifying the program. 

The Foreign Intelligence Surveillance Court (FISC), which oversees the intelligence community’s surveillance operations, authorized the data collection program in May 2006 under section 215 of the Patriot Act, often referred to as the “business records provision.” Under section 215, the government can collect only data that is “relevant” to an ongoing foreign intelligence investigation. The big question swirling since Snowden’s leaks is whether the phone data collection program violates section 215 by collecting data that is not relevant. International Business Times dug into the government’s arguments on the relevance issue and the merits of those arguments. 

“The results of EFF’s FOIA [Freedom of Information Act] lawsuit will finally lift the veil on the dubious legal underpinnings of NSA’s domestic phone surveillance program,” EFF activist Trevor Timm wrote in a blog post Thursday announcing the victory. 

According to the DOJ’s court filing Wednesday, the department will release: "[O]rders and opinions of the FISC issued from January 1, 2004, to June 6, 2011, that contain a significant legal interpretation of the government’s authority or use of its authority under Section 215; and responsive “significant documents, procedures, or legal analyses incorporated into FISC opinions or orders and treated as binding by the Department of Justice or the National Security Agency.”

“For most of the duration of the lawsuit, the government fought tooth and nail to keep every page of its interpretations secret, even once arguing it should not even be compelled to release the number of pages that their opinions consisted of,” Timm wrote. “It was not until the start of the release of documents leaked by NSA whistle-blower Edward Snowden that the government’s position became untenable and the court ordered the government to begin the declassification review process.”

This is the second victory for EFF in recent weeks. Last month, the DOJ agreed to release a 2011 FISC opinion on illegal surveillance activity that EFF had been suing for for more than a year. The new documents will be made public on or before Sept. 10.