The same White House and members of Congress that defended the National Security Agency’s secret bulk collection of telephone data last summer as critical to ferreting out terrorist attacks before they happen on Tuesday effusively praised proposals by President Barack Obama that would essentially end the program.

Acknowledging outcries from privacy advocates over the depth and scope of the NSA program, the administration is expected to propose this week that the NSA halt its daily collection of millions of telephone records and end its storage of the information, known as metadata, for as long as five years.

Instead, the White House will propose that the phone companies hold onto the records for 18 months, about what they do now for administrative purposes. The NSA would be able to get records for specific information only with permission from a judge through a court order.

“I am confident that it allows us to do what is necessary in order to deal with the dangers from the terrorist attack, but does so in a way that addresses some of the concerns that people raised,” Obama said Tuesday of the proposal at a news conference in The Hague.

“I recognize that because of these revelations, that there’s a process that’s taking place where we have to win back the trust not just of governments, but more importantly, of ordinary citizens,” he said. “And that’s not going to happen overnight, because there’s a tendency to be skeptical of government and to be skeptical in particular of U.S. intelligence services.”

On Capitol Hill, Sen. Ron Wyden, D-Ore., one of the NSA’s most vociferous critics, declared victory in his long campaign to publicize and then end the program.

“What you’re hearing is the end of dragnet surveillance in America,” he said. Then he remarked on the irony that was difficult to ignore in the White House proposal.

“What is striking is for years the executive branch said collecting all of the phone records on law-abiding Americans was absolutely vital to our security and we kept saying it wasn’t, and now it’s clear they pretty much reached our position,” he said.

The White House plan is similar to a bill introduced Tuesday by Reps. Mike Rogers, R-Mich., and C.A. “Dutch” Ruppersberger, D-Md., the chairman and top Democrat on the House Intelligence Committee.

The bill is a shift for Rogers and Ruppersberger, who staunchly defended the NSA after leaks by Edward Snowden exposed the agency’s activities.

In July, the House of Representatives narrowly defeated a proposal by an alliance of Republican conservatives and Democratic liberals to dramatically curtail the NSA program to collect certain phone records.

The bid to change the program was defeated only after intensive lobbying by Rogers, Republican leaders and the White House.

“What you’re doing is taking away one tool that we know will allow us the nexus between a foreign terrorist overseas talking to someone in the United States,” Rogers said at the time. “It has saved real lives, real folks have come home with their legs . . . because of this program.”

Several independent reviews of the program, including one ordered by the White House, concluded, however, that the metadata program had contributed little, if anything, to the discovery of terrorist plots. On Tuesday, Rogers called his bill overhauling the program “a significant step, an important step.”

Ruppersberger continued to speak favorably of the NSA program, saying the media overstated the agency’s activities. Still, he said he and Rogers decided to seek changes to regain public trust.

“It’s not about the NSA, that the system we had didn’t work, it’s about the public perception,” he said. “You have to listen to constituents. Unfortunately, the national media said, ‘They’re listening to your conversations,’ and as a result of that, a lot of people in this country, including a lot of my constituents, felt, and I was hearing this, that ‘the government is listening to us.’ It was not the case.”

Sen. Dianne Feinstein, D-Calif., the Senate Intelligence Committee chairwoman who also defended the NSA in June in a strongly worded joint statement with top Republican Saxby Chambliss of Georgia, on Tuesday called Obama’s proposal “a worthy effort.”

“I have said before that I am open to reforming the call records program as long as any changes meet our national security needs and address privacy concerns, and that any changes continue to provide the government with the means to protect against future terrorist attacks,” she said.

Not all lawmakers were quick to embrace the proposed changes. Sen. Kelly Ayotte, R-N.H., said she needs more information before deciding whether to support it.

“I believe it’s very important that we not undermine this program,” she said. She also questioned whether leaving the data with the phone companies, which routinely record it for billing purposes, doesn’t raise privacy risks. “Obviously” she said, “it being held in private institutions raises as many privacy questions in my view as it does with the government having collection.”