Moving to tamp down a public uproar spurred by the disclosure of two secret surveillance programs, the top intelligence official in the U.S. is declassifying key details about one of the programs while insisting the efforts were legal, limited in scope and necessary to detect terrorist threats.

Director of National Intelligence James Clapper, in an unusual late-night statement Thursday, denounced the leaks of highly classified documents that revealed the programs and warned that America's security will suffer. He called the disclosure of a program that targets foreigners' internet use "reprehensible," and said the leak of another program that lets the government collect Americans' phone records would affect how America's enemies behave and make it harder to understand their intentions.

"The unauthorized disclosure of a top secret U.S. court document threatens potentially long-lasting and irreversible harm to our ability to identify and respond to the many threats facing our nation," Clapper said of the phone-tracking program.

At the same time, he offered new information about both programs, saying he wanted to correct the "misleading impression" created by out-of-context news articles even as he acknowledged that publicly discussing the programs comes with inherent security risks.

"I believe it is important for the American people to understand the limits of this targeted counterterrorism program and the principles that govern its use," Clapper said.

And so barely 24 hours after the phone records program's existence was first revealed publicly, Clapper took the rare step of declassifying and publicly releasing details about the authority used to authorize it, including that it's reviewed by a special court every three months and that the data collected can only be culled when there's reasonable suspicion — backed by facts — that the information is connected to a foreign terrorist group.

The Obama administration's defence of the two programs came as members of Congress were vowing to change a program they voted to authorize and exasperated civil liberties advocates were crying foul, questioning how U.S. President Barack Obama, a former constitutional scholar who sought privacy protections as a U.S. senator, could embrace policies with strong echoes of president George W. Bush, whose approach to national security he had vowed to leave behind.

'Ongoing, daily' collection of phone records

At issue were two National Security Agency programs that came to light late Wednesday and Thursday after highly classified documents were leaked to the media.

A top-secret court order, first disclosed by the Guardian newspaper in Britain, requires the communications company Verizon to turn over on an "ongoing, daily basis" the records of all landline and mobile telephone calls of its customers, both within the U.S. and between the U.S. and other countries. Experts said it's likely the program extends to other phone companies as well.

Another secret program came to light when The Washington Post and The Guardian reported that the NSA and FBI can scour the nation's main internet companies, extracting audio, video, emails and other documents to help analysts track a person's movements and contacts. Microsoft, Yahoo, Google, Facebook, PalTalk, AOL, Skype, YouTube and Apple were all included. Most denied giving the government direct access.

The Obama administration on Thursday defended the National Security Agency's need to collect telephone records of U.S. citizens, calling such information a critical tool in protecting the nation from terrorist threats. (Patrick Semansky/Associated Press)

Clapper alleged that articles about the internet program "contain numerous inaccuracies." He did not specify what those inaccuracies might be.

Senior administration officials defended the programs as critical tools and said the intelligence they yield is among the most valuable data the U.S. collects. Clapper said the internet program, known as PRISM, can't be used to intentionally target any Americans or anyone in the U.S. He said a special court, Congress and the executive branch all oversee the program and that data accidentally collected about Americans is kept to a minimum.

The phone records program, too, has been taken out of context, Clapper alleged. His defence was echoed hours earlier by leaders of Congress' intelligence panels, who dismissed the furor over what they said was standard three-month renewal to a program that's operated for seven years. Committee leaders also said the program recently helped thwart what would have been a significant domestic terrorist attack.

The NSA must collect the phone data in broad swaths, Clapper said, because collecting it narrowly would make it harder to identify terrorism-related communications. The court prohibits the government from indiscriminately rummaging through the phone data without evidence of a terrorist group connection, he said.

But the widespread notion of a government dragnet ensnaring terror suspects and innocent Americans pushed typical political foes to stand together against Obama as he enforces what many likened to Bush-era policies.

"When law-abiding Americans make phone calls, who they call, when they call and where they call from is private information," said Senator Ron Wyden, a Democrat from Oregon. "As a result of the disclosures that came to light today, now we're going to have a real debate in the Congress and the country and that's long overdue."

Officials from Clapper's office, the Justice Department, NSA and FBI briefed 27 senators for some two hours late Thursday at a hurriedly convened session prompted by severe criticism and uncertainty about the program.

"The National Security Agency's seizure and surveillance of virtually all of Verizon's phone customers is an astounding assault on the Constitution," said Senator Rand Paul, a Republican from Kentucky. "After revelations that the Internal Revenue Service targeted political dissidents and the Department of Justice seized reporters' phone records, it would appear that this administration has now sunk to a new low."

Paul said he will introduce legislation ensuring that the Fourth Amendment rights against unreasonable searches and seizures apply to government search of phone records.

Powers granted under Patriot Act

The surveillance powers are granted under the post-9/11 Patriot Act, which was renewed in 2006 and again in 2011. Republicans who usually don't miss a chance to criticize the administration offered full support.

"I'm a Verizon customer. I could care less if they're looking at my phone records … If you're not getting a call from a terrorist organization, you got nothing to worry about," said Senator Lindsey Graham, a South Carolina Republican.

The possibility of a third secret program letting the NSA tap into credit card transaction records emerged late Thursday in a report in The Wall Street Journal. The White House did not immediately respond to an inquiry about that program.

The disclosures come at a particularly inopportune time for Obama. His administration already faces questions over the Internal Revenue Service's improper targeting of conservative groups, the seizure of journalists' phone records in an investigation into who leaked information to the media, and the handling of an attack in Libya that left four Americans dead.

At a minimum, it's all a distraction as the president tries to tackle big issues like immigration reform and taxes. And it could serve to erode trust in Obama as he tries to advance his second-term agenda and cement his presidential legacy.

The Verizon order, granted by the secret Foreign Intelligence Surveillance Court on April 25 and good until July 19, requires information on the phone numbers of both parties on a call, as well as call time and duration, and unique identifiers, The Guardian reported.

It does not authorize snooping into the content of phone calls. But with millions of phone records in hand, the NSA's computers can analyze them for patterns, spot unusual behavior and identify "communities of interest" — networks of people in contact with targets or suspicious phone numbers overseas.

Once the government has zeroed in on numbers that it believes are tied to terrorism or foreign governments, it can go back to the court with a wiretap request. That allows the government to monitor the calls in real time, record them and store them indefinitely.

House Intelligence Chairman Mike Rogers, a Republican from Michigan, said that once the data has been collected, officials still must follow "a court-approved method and a series of checks and balances to even make the query on a particular number."

The steps are shrouded in government secrecy, which some lawmakers say should change.

"The American public can't be kept in the dark about the basic architecture of the programs designed to protect them," said Senator Al Franken, a Democrat from Minnesota.

Verizon says it must comply with court orders

Verizon Executive Vice President and General Counsel Randy Milch, in a blog post, said the company can't comment on any such court order. He said Verizon takes steps to protect customers' privacy, but must comply with court orders. Verizon listed 121 million customers in its first-quarter earnings report this April.

The NSA is sensitive to perceptions that it might be spying on Americans. It distributes a brochure that pledges the agency "is unwavering in its respect for U.S. laws and Americans' civil liberties — and its commitment to accountability."

Emerging from the briefing, Sen. Dianne Feinstein, a Democrat from California, chairwoman of the Intelligence committee, said the government must gather intelligence to prevent plots and keep Americans alive. "That's the goal. If we can do it another way, we're looking to do it another way. We'd like to."

She said Congress is always open to changes, "but that doesn't mean there will be any."