The US 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 at a rare open hearing on intelligence - a set-piece for supporters of the snooping.

The US House Intelligence Committee, led by lawmakers sympathetic to the extraordinary surveillance, provided a venue for officials to defend the once-secret programs. There was limited probing of claims that the collection of people's phone records and Internet usage has disrupted dozens of terrorist plots, and few details were volunteered.

Army General Keith Alexander, director of the National Security Agency, said the two recently disclosed programs - one that gathers US phone records and another that is designed to track the use of US-based internet servers by foreigners with possible links to terrorism - are critical. But details about them were not closely held within the secretive agency.

General Alexander said after the hearing that the documents accessed by whistleblower Edward Snowden, a 29-year-old former systems analyst on contract to the NSA, were on a web forum available to all NSA employees.

He said the NSA was monitoring a known extremist in Yemen who was in contact with an individual in the United States. Identifying that person and other individuals, General Alexander said, officials "were able to detect a nascent plot to bomb the New York Stock Exchange. ... The FBI disrupted and arrested these individuals."

The programs "assist the intelligence community to connect the dots," General Alexander told the committee in a rare, open Capitol Hill hearing.

General Alexander got no disagreement from the leaders of the panel, who have been outspoken in backing the programs.

He told lawmakers Mr Snowden's leaks have caused "irreversible and significant damage to this nation" and undermined the US relationship with allies.

When Deputy FBI Director Sean Joyce was asked what is next for Mr Snowden, he said, simply, "justice." Ms Snowden fled to Hong Kong and is in hiding, although he answered questions in a live Q&A web chat this week.

Intelligence officials last week disclosed some details on what they said were two thwarted attacks, one targeting the New York subway system and one a Danish newspaper office that had published the cartoon depictions of the Mohammad. Yesterday, General Alexander said more than 50 terrorist acts were averted because of the surveillance programs in question.

In one example, Mr Joyce said the NSA was able to identify an extremist in Yemen who was in touch with someone in Kansas City, Missouri, enabling authorities to identify co-conspirators and thwart a plot to bomb the New York Stock Exchange. He said this was made possible by one of the surveillance programs disclosed by Mr Snowden, but he did not say which one.

Mr Joyce also said a terrorist financier inside the US 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, Mr Joyce said. He confirmed under questioning that the calls were to Somalia.

General Alexander said the internet program PRISM had helped stop 90 per cent of the 50-plus plots he cited. He said just over 10 of the plots thwarted had a connection inside the US 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, US 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 without a warrant. 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, Republican-Michigan, and Representative. C.A. Dutch Ruppersberger of Maryland, the panel's top Democrat, said the programs were vital to the intelligence community and assailed Mr 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," Mr Rogers said.

Mr 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 Mr Snowden was able to access and then disclose.

General Alexander said Mr 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 consulting firm Booz Allen Hamilton.

"Egregious, egregious leaks," Mr Joyce said.

But after the hearing, General Alexander said almost all of the documents Mr 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 US - 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 US 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.

Mr 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 authorise dissemination of information to the FBI related to a US 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.

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

The hearing came the morning after Mr Obama vigorously defended the surveillance programs in a lengthy interview, calling them transparent - even though they are authorised in secret.

Mr 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.

Mr 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 Mr Obama conceded in his interview without mentioning Mr Snowden.

"We might have caught him some other way," Mr 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," he said.

Mr Obama repeated earlier assertions that the NSA programs were a legitimate counterterror tool and that they were completely non-invasive to people with no terror ties - something he hoped to discuss with the privacy and civil liberties board he'd formed. The senior administration official said the president would be meeting with the new privacy board in the coming days.

"We're going to have to find ways where the public has an assurance that there are checks and balances in place ... that their phone calls aren't being listened into; their text messages aren't being monitored, their emails are not being read by some Big Brother somewhere," said Mr Obama.