WASHINGTON -- The director of the National Security Agency said Tuesday the U.S. government's sweeping surveillance programs have foiled some 50 terrorist plots worldwide, including one directed at the New York Stock Exchange, in a forceful defence of spy operations that was echoed by the leaders of the House Intelligence Committee.

Army Gen. Keith Alexander 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 in the terrorism fight.

Intelligence officials last week disclosed some details on two thwarted attacks -- one targeting the New York subway system, one to bomb a Danish newspaper office that had published the cartoon depictions of the Prophet Mohammad. Alexander and Sean Joyce, deputy director of the Federal Bureau of Investigation, offered additional details on two other foiled plots, including one targeting Wall Street.

Under questioning, Joyce said the NSA was able to identify an extremist in Yemen who was in touch with an individual in Kansas City, Missouri. They were able to identify co-conspirators and thwart a plot to bomb the New York Stock Exchange.

Joyce also said a terrorist financier inside the U.S. was identified and arrested in October 2007, thanks to a phone record provided by the NSA. The individual was making phone calls to a known designated terrorist group overseas.

Rep. Mac Thornberry, a Republican, asked if that country was Somalia, which Joyce confirmed though he said that U.S. counterterrorist activities in that country are classified.

The programs "assist the intelligence community to connect the dots," Alexander told the committee in a rare, open congressional hearing. He said the intelligence community would provide the committees with more specifics on the 50 cases as well as the exact numbers on foiled plots in Europe.

Alexander got no disagreement from the leaders of the panel, who have been outspoken in backing the programs since Edward Snowden, a 29-year-old former contractor with Booz Allen Hamilton, disclosed information to The Washington Post and the Guardian newspapers.

Rep. Mike Rogers, the Republican chairman of the committee, and Rep. C.A. Dutch Ruppersberger, 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.

Alexander and Joyce said Snowden's disclosures did significant damage to the government and its operations.

"Egregious, egregious leaks," Joyce said. Alexander said the leaks affect the U.S. relationship with its allies.

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 someone they 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 travelled into the U.S. without their knowledge, they have to "purge" that from their 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 there were 10 people involved in that process, including himself and Inglis.

The hearing came the morning after President Barack Obama, who attended the G-8 summit in Ireland, vigorously defended the surveillance programs in a lengthy interview Monday, calling them transparent -- even though they are authorized in secret.

"It is transparent," Obama told PBS television's Charlie Rose in an interview. "That's why we set up the FISA court," the president added, referring to the secret court set up by the Foreign Intelligence Surveillance Act that authorizes 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.

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

"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," the president said.