Top U.S. intelligence officials struggled to determine whether one of the National Security Agency's most treasured surveillance programs actually stopped any terrorist attacks, according to a newly unsealed report prepared by five of the highest-ranking inspectors general in the government half a dozen years ago. The officials were divided over the legality and usefulness of the program, dubbed Stellar Wind, in part because it was shrouded in secrecy.

The American public had its first glimpse of the Stellar Wind program when Edward Snowden, a former contract employee of the NSA, began leaking classified documents to international news outlets in June 2013. The program enabled the NSA to wiretap Americans' international phone calls and collect information about the calls as well as emails without warrants issued by the Foreign Intelligence Surveillance Act court. However, top U.S. lawmakers were debating the effect of the program long before the Snowden leaks, according to a declassified document furnished to the New York Times Friday.

Responding to the terrorist attacks on Sept. 11, 2001, then-President George W. Bush secretly authorized the NSA to collect information on Americans' communications. Neither the Justice Department's top intelligence lawyer nor most low-level CIA officials were told about the program, and the judges involved weren't allowed to keep copies of the Justice Department's legal rationale.

The report released to the New York Times Friday -- prepared by the inspectors general at the NSA, CIA, Defense Department, Justice Department and Office of the Director of National Intelligence -- found the secrecy surrounding the plan undercut its goal. Stellar Wind was legalized by Congress in 2007. That should have happened sooner to eliminate "the substantial restrictions placed on FBI agents' and analysts' access to and use of program-derived information due to the highly classified status" of Stellar Wind, the Times quoted the report as saying.

The report was made public as the result of a Freedom of Information Act request made by the Times.

It calls into question the truthfulness of former Attorney General Alberto Gonzales' testimony at a Senate Judiciary Committee hearing in 2006. “Although we believe that Gonzales did not intend to mislead Congress, we believe his testimony was confusing, inaccurate and had the effect of misleading those who were not knowledgable about the program,” the Times quoted the report as saying. This is an important point because few officials would have been knowledgeable about the program at the time.