NSA spying under fire: 'You've got a problem' (VIDEO)

WASHINGTON (AP) - In a heated confrontation over domestic spying, members of Congress said Wednesday they never intended to allow the National Security Agency to build a database of every phone call in America. And they threatened to curtail the government's surveillance authority.

Top Obama administration officials countered that the once-secret program was legal and necessary to keep America safe. And they left open the possibility that they could build similar databases of people's credit card transactions, hotel records and Internet searches.

The clash on Capitol Hill undercut President Barack Obama's assurances that Congress had fully understood the dramatic expansion of government power it authorized repeatedly over the past decade.

The House Judiciary Committee hearing also represented perhaps the most public, substantive congressional debate on surveillance powers since the 9/11 terrorist attacks. Previous debates have been largely theoretical and legalistic, with officials in the Bush and Obama administrations keeping the details hidden behind the cloak of classified information.

That changed last month when former government contractor Edward Snowden leaked documents to the Guardian newspaper revealing that the NSA collects every American's phone records, knowing that the overwhelming majority of people have no ties to terrorism.

Civil rights groups have warned for years that the government would use the USA Patriot Act to conduct such wholesale data collection. The government denied it.

The Obama administration says it needs a library of everyone's phone records so that when it finds a suspected terrorist, it can search its archives for the suspect's calling habits. The administration says the database was authorized under a provision in the Patriot Act that Congress hurriedly passed after 9/11 and reauthorized in 2005 and 2010.

The sponsor of that bill, Rep. James Sensenbrenner, R-Wis., said Wednesday that Congress meant only to allow seizures directly relevant to national security investigations. No one expected the government to obtain every phone record and store them in a huge database to search later.

As Deputy Attorney General James Cole explained why that was necessary, Sensenbrenner cut him off and reminded him that his surveillance authority expires in 2015.

"And unless you realize you've got a problem," Sensenbrenner said, "that is not going to be renewed."

Click here if video fails to load automatically