WASHINGTON — The U.S. foiled a plot to bomb the New York Stock Exchange because of the sweeping surveillance programs at the heart of a debate over national security and personal privacy, officials said Tuesday at a rare open hearing on intelligence led by lawmakers sympathetic to the spying.

The House Intelligence Committee hearing provided a venue for officials to defend the once-secret programs and did little probing of claims that the collection of people’s phone records and Internet usage has disrupted dozens of terrorist plots. Few details were volunteered.

Army Gen. Keith Alexander, director of the National Security Agency, said the two recently disclosed programs — one that gathers U.S. phone records and another that is designed to track the use of U.S.-based Internet servers by foreigners with possible links to terrorism — are critical. But details about them were not closely held within the secretive agency. Alexander said after the hearing that most of the documents accessed by Edward Snowden, a 29-year-old former systems analyst on contract to the NSA, were on a web forum available to many NSA employees. Others were on a site that required a special credential to access. Alexander said investigators are studying how Snowden did that.

He told lawmakers Snowden’s leaks have caused “irreversible and significant damage to this nation” and undermined the U.S. relationship with allies.

When Deputy FBI Director Sean Joyce was asked what is next for Snowden, he said, simply, “justice.” Snowden fled to Hong Kong and is hiding.

In the days after the leaks, House Intelligence committee Chairman Mike Rogers cited one attack that he said was thwarted by the programs. In the comments of other intelligence officials, that number grew to two, then 10, then dozens. On Tuesday, Alexander said more than 50 attacks have been averted because of the surveillance. These included plots against the New York subway system and a Danish newspaper office that had published cartoon depictions of Muhammad.

In a new example, Joyce said the NSA was able to identify an extremist in Yemen who was in touch with Khalid Ouazzani in Kansas City, Mo., enabling authorities to identify co-conspirators and thwart a plot to bomb the New York Stock Exchange.

Ouazzani pleaded guilty in May 2010 in federal court in Missouri to charges of conspiracy to provide material support to a terrorist organization, bank fraud and money laundering. Ouazzani was not charged with the alleged plot against the stock exchange. Joyce said the arrest was made possible by the Internet surveillance program disclosed by Snowden.

Joyce also said a terrorist financier in San Diego was identified and arrested in October 2007 because of a phone record provided by the NSA.

The individual was making phone calls to a known designated terrorist group overseas, Joyce said. He confirmed under questioning that the calls were to Somalia.

Alexander said the Internet program had helped stop 90 percent of the 50-plus plots he cited. He said just over 10 of the plots thwarted had a connection inside the U.S. and most were helped by the review of phone records. Still, little was offered to substantiate claims that the programs have been successful in stopping acts of terrorism that would not have been caught with narrower surveillance. In the New York subway bombing case, President Barack Obama conceded the would-be bomber might have been caught with less sweeping surveillance.

Officials have long had the authority to monitor email accounts linked to terrorists but, before the law changed, needed to get a warrant by showing that the target was a suspected member of a terrorist group. In the disclosed Internet program named PRISM, the government collects vast amounts of online data and email, sometimes sweeping up information on ordinary American citizens. Officials now can collect phone and Internet information broadly but need a warrant to examine specific cases where they believe terrorism is involved.

Committee chairman Mike Rogers, R-Mich., and Rep. C.A. Dutch Ruppersberger of Maryland, the panel’s top Democrat, said the programs were vital to the intelligence community and assailed Snowden’s actions as criminal.

“It is at times like these where our enemies within become almost as damaging as our enemies on the outside,” Rogers said.

Ruppersberger said the “brazen disclosures” put the United States and its allies at risk.

Committee members were incredulous about the scope of the information that Snowden was able to access and then disclose.

Alexander said Snowden had worked for 12 months in an information technology position at the NSA office in Hawaii under another contract preceding his three-month contract with Booz Allen.

“Egregious, egregious leaks,” Joyce said.

But after the hearing, Alexander said almost all of the documents Snowden leaked were on an internal online library.

“They are on web forums that are publicly available in the NSA,” he said.

The general counsel for the intelligence community said the NSA cannot target phone conversations between callers inside the U.S. — even if one of those callers was targeted for surveillance when outside the country.

The director of national intelligence’s legal chief, Robert S. Litt, said that if the NSA finds it has accidentally gathered a phone call by a target who had traveled into the U.S. without the agency’s knowledge, it has to “purge” that from system. The same goes for an accidental collection of any conversation because of an error.

Litt said those incidents are then reported to the Foreign Intelligence Surveillance Court, which “pushes back” and asks how it happened, and what the NSA is doing to fix the problem so it doesn’t happen again.

Deputy NSA Director Chris Inglis said a limited number of officials at the agency could authorize dissemination of information to the FBI related to a U.S. citizen, and only after determining it was necessary to understand a counterterrorism issue. Information related to an American who is found not to be relevant to a counterterrorism investigation must be destroyed, he added.

Alexander said 10 people were involved in that process, including himself and Inglis.

The hearing came the morning after President Barack Obama vigorously defended the surveillance programs in a lengthy interview, calling them transparent — even though they are authorized in secret.

Obama said he has named representatives to a privacy and civil liberties oversight board first established in 2004 to help in the debate over just how far government data gathering should be allowed to go. The discussion is complicated by the secrecy surrounding the surveillance court, with hearings held at undisclosed locations and with only government lawyers present. The orders that result are all highly classified.

Snowden on Monday accused members of Congress and administration officials of exaggerating their claims about the success of the data gathering programs, including pointing to the arrest of the would-be New York subway bomber, Najibullah Zazi, in 2009.

In an online interview with The Guardian in which he posted answers to questions, he said Zazi could have been caught with narrower, targeted surveillance programs — a point Obama conceded in his interview without mentioning Snowden.

“We might have caught him some other way,” Obama said. “We might have disrupted it because a New York cop saw he was suspicious. Maybe he turned out to be incompetent and the bomb didn’t go off. But, at the margins, we are increasing our chances of preventing a catastrophe like that through these programs.”

*We welcome your comments on the stories and issues of the day and seek to provide a forum for the community to voice opinions. All comments are subject to moderator approval before being made visible on the website but are not edited. The use of profanity, obscene and vulgar language, hate speech, and racial slurs is strictly prohibited. Advertisements, promotions, spam, and links to outside websites will also be rejected. Please read our terms of service for full guides