WASHINGTON — The disclosure of a top-secret order allowing the Obama administration to obtain phone records of millions of Americans reignited a national debate on Thursday about whether the White House is violating civil liberties, with Massachusetts lawmakers among the most vocal critics.

But the administration and several top US lawmakers defended the program as a vital and necessary tool in continuing to combat potential terrorists. Representative Mike Rogers, chairman of the House Intelligence Committee, said that the phone records had helped avert a domestic terrorist attack in recent years. Details remained classified.

Several members of the all-Democratic Massachusetts congressional delegation, which has been largely opposed to the government program that allows for such phone record monitoring, were harshly critical of Obama’s action.

“This is absolutely horrendous,” said Representative Michael E. Capuano, a Somerville Democrat. “Do we or don’t we want an open society? And my answer is, without that we don’t have an America.”

The scope of the monitoring appeared to be much broader than just the phone records. The Washington Post reported late on Thursday that the government is currently tapping directly into the central servers of nine top US Internet companies, including Yahoo, Google, Facebook, and Skype. Government analysts are able to extract audio, video, photos, and e-mails to track a person’s movements and contacts.

Director of National Intelligence James Clapper denounced the disclosure of highly secret documents Thursday. He said he was declassifying some aspects of the monitoring to help Americans understand it better.

Clapper said the leak that revealed a program to collect phone records would affect how America’s enemies behave and make it harder to understand their intentions.

Earlier in the day, White House spokesman Josh Earnest called the monitoring program a “critical tool,” saying Obama “welcomes the discussion of the trade-off” involved in seeking such private records to try to gain intelligence about possible terrorist threats.

The controversy created an unusual dynamic in Washington, with a number of liberal Democrats, including those from Massachusetts, blasting the administration, while many conservative Republicans supported Obama. The domestic surveillance program began under the George W. Bush administration and has been reauthorized under Obama.

Rogers, a Michigan Republican, defended the White House at a Capitol Hill press conference, saying the “important” program had been used to stop a terrorist attack on the United States. He said he would try to get the incident declassified so details could be provided.

“It fills in a little seam that we have, and it’s used to make sure that there’s not an international nexus to any terrorism event that they may believe is ongoing in the United States,” Rogers said.

The government order for obtaining phone records was first reported on Wednesday by Britain’s Guardian newspaper, which obtained a copy of the document requiring Verizon to provide the National Security Agency with daily logs of telephone calls by its customers. The NSA, whose secretive nature has led wags to say its initials stand for “No Such Agency,” is a Maryland-based federal facility that specializes in collecting and analyzing information from electronic signals, including telephones.

The order for Verizon records was made under a section of the Patriot Act that allows the government to demand information from telephone carriers as long as they gain approval from the Foreign Intelligence Surveillance Court. The information is not supposed to include the content of the calls, according to lawmakers, but does include information such as a telephone number and how long a call lasted.

Clapper said he wanted to correct the ‘‘misleading impression’’ created by the article that disclosed the existence of the phone records program. To that end, Clapper said he was immediately declassifying and releasing to the public certain details about the FISA provision that governs the program.

A special panel known as the FISA Court authorizes the phone records program and reviews it every 30 days, Clapper said, adding that the Justice Department oversees information acquired under the court order. He said only a small fraction of the records get examined because most are unrelated to inquiries into terrorism activities.

The court also prohibits the government from indiscriminately rummaging through the phone data, which he said can only be queried when there are specific facts to back up a suspicion of an association with a foreign terrorist group.

It is not clear whether phone companies besides Verizon also were required to turn over records. But the government last year submitted 1,789 applications to the secret court that authorizes searches for electronic surveillance.

The government later withdrew one application; the rest were approved, according to data compiled by the attorney general’s office.

The law allowing the government to obtain the phone records was reauthorized in December 2012, following overwhelming votes in both the House and Senate to renew the laws for another five years.

Both Massachusetts senators at the time — Scott Brown, a Republican, and John Kerry, a Democrat — voted for reauthorization. But in the House, all Massachusetts lawmakers except for Stephen Lynch of South Boston voted against the measure.

Representative Edward J. Markey, a Malden Democrat now running for Senate, said the Obama administration needs greater scrutiny from him and his colleagues on these issues.

“There has to be much greater congressional oversight of government surveillance programs,” Markey said.

Representative Niki Tsongas, a Lowell Democrat, called on the administration to provide answers, saying, “privacy in this digital age is certainly not a trivial matter.”

Representative Jim McGovern, a Worcester Democrat, said the phone record monitoring was threatening the principles the country was founded upon. “We’re going down a road that compromises some of the values and traditions that we have held as sacred for many, many years,” he said.

Senator Elizabeth Warren, the Massachusetts Democrat who took office in January, who said she had no prior knowledge of the program, said, “I’m very concerned about it, but I want to learn more.” Senator William “Mo” Cowan, the Massachusetts Democrat who is temporarily filling the seat until voters select a replacement on June 25, also wants more information.

But some Democrats supported the order and said they knew about it. Senator Dianne Feinstein of California, who is chairwoman of the Senate Intelligence Committee, said that all senators were given opportunities to review classified information on the program.

“Terrorists will come after us if they can,” she said. “The only thing we have to deter this is good intelligence . . . and to get to them before they get to us.”

House Speaker John Boehner did not criticize the surveillance program, but he called on Obama to explain it to the American public, and justify why he thinks it is important.

The revelation came at a time of increasing angst among civil libertarians about federal actions.

The Obama administration was criticized last month after the Justice Department secretly obtained phone records from the Associated Press as part of a leak investigation into a story about the CIA thwarting a terrorist plot originating in Yemen.

The Supreme Court on Monday ruled that states could allow law enforcement officials to routinely obtain DNA swabs from those who were arrested, but not yet convicted of a crime.

Since Obama took office, critics have accused him of being too quick to embrace Bush administration policies that he once disavowed.

Obama co-sponsored legislation when he was a US senator in 2005 that would have limited the government’s ability to seize phone records, essentially prohibiting the type of mass collection of records with which his administration is now involved.

Obama recently expressed concern about striking the right balance on a range of national security issues, from whether journalists should have their phone records seized in leak investigations to whether the government can and should authorize drone attacks of American citizens on foreign soil.

The Republican Party, meanwhile, showed signs of splintering on the issue.

“I’m a Verizon customer,” Senator Lindsey Graham, a South Carolina Republican, said in a congressional hearing. “It doesn’t bother me one bit that the National Security Agency has my phone number.”

But Senator Rand Paul, the Kentucky Republican and a Tea Party movement leader, said surveillance had gone too far.

“I’m all for going after terrorists. I’m all for going after criminals, but I think you go to a judge and you ask for a warrant specified to a person,” Paul said. “You shouldn’t look at millions of records.”