WASHINGTON — Breaking a long silence about a high-profile National Security Agency program that sifts records of Americans’ telephone calls and text messages in search of terrorists, the Trump administration on Thursday acknowledged for the first time that the system has been indefinitely shut down — but asked Congress to extend its legal basis anyway.

In a letter to Congress delivered on Thursday and obtained by The New York Times, the administration urged lawmakers to make permanent the legal authority for the National Security Agency to gain access to logs of Americans’ domestic communications, the USA Freedom Act. The law, enacted after the intelligence contractor Edward J. Snowden revealed the existence of the program in 2013, is set to expire in December, but the Trump administration wants it made permanent.

The unclassified letter, signed on Wednesday by Dan Coats in one of his last acts as the director of National Intelligence, also conceded that the N.S.A. has indefinitely shut down that program after recurring technical difficulties repeatedly caused it to collect more records than it had legal authority to gather. That fact has previously been reported, but the administration had refused to officially confirm its status.

“The National Security Agency has suspended the call detail records program that uses this authority and deleted the call detail records acquired under this authority,” Mr. Coats wrote. “This decision was made after balancing the program’s relative intelligence value, associated costs, and compliance and data integrity concerns caused by the unique complexities of using these company-generated business records for intelligence purposes.”

Complicating matters, three other surveillance authorities primarily used by the F.B.I. are also set to expire in mid-December. They include provisions that let investigators get court orders to collect business records relevant to a national security investigation, wiretap “lone wolf” terrorists without links to a foreign power, and keep wiretapping someone suspected of being a spy or a terrorist who switches phone lines in an effort to evade surveillance.

Mr. Coats’s letter said the administration supported making those three provisions permanent as well, rather than merely subjecting them to another extension of several years, as Congress has previously done.

The executive branch had been internally divided over whether to push for an extension of the part of the Freedom Act that authorizes the phone records program. Months ago, the N.S.A. presented a bleak assessment of the program to the White House, saying it carried high costs and few benefits, but some officials argued that it made sense to keep the legal authority in case technical solutions emerged to make it work better, according to officials familiar with internal deliberations.

Mr. Coats’s letter adopted the latter argument, saying the administration supports permanently reauthorizing the provision even though the system was dysfunctional. He noted that “as technology changes, our adversaries’ tradecraft and communications habits will continue to evolve and adapt,” suggesting that such a system might become more useful.

While extending the three other provisions is less disputed, their fate will now be caught up in a broader debate about the phone records law. Privacy advocates, including Patrick Toomey of the American Civil Liberties Union, called for Congress to instead let the phone records program die.

“It’s long past time that this surveillance program was shuttered once and for all,” Mr. Toomey said. “The NSA has been vacuuming up hundreds of millions of Americans’ call records as part of a program that is hopelessly complex and lacks any discernible evidence of its value. We should not leave such a sweeping, unaccountable power in the hands of our spy agencies.”

The Times reported last month that the House Judiciary Committee has already started drafting a bill to extend the three expiring F.B.I. tools, but without extending the N.S.A. phone records program.

The N.S.A.’s ability to gain access to and analyze Americans’ domestic calling records traces back to the aftermath of the Sept. 11, 2001, terrorist attacks, when the Bush administration set up its then-secret Stellarwind program. It was a basket of surveillance and bulk data collection activities that relied on a raw claim of executive power to bypass legal constraints.

One component of the program collected customer calling records from large telecoms like AT&T and MCI, which later became Verizon. The N.S.A. used the metadata — logs showing who contacted whom, but not what was said — as a social map, scrutinizing indirect links between people as it hunted for hidden associates of known terrorism suspects.

In 2006, the Foreign Intelligence Surveillance Court began issuing secret orders requiring the companies to participate in the program.

The orders were based on a creative and disputed interpretation of Section 215 of the Patriot Act, which said the F.B.I. may obtain business records “relevant” to a terrorism investigation. The spy court decided that all records could be seen as “relevant” — a theory that a federal appeals court would later reject as stretching the law too far.

But the bulk phone records program clearly came into public view only in June 2013 when The Guardian published the first revelation from the trove of classified files leaked by Mr. Snowden, the former intelligence contractor. It was a top-secret surveillance court order to Verizon requiring it to give the N.S.A. a copy of all customer calling records.

In the ensuing debate, intelligence officials could not point to any specific attack the program had thwarted. But they defended it as a useful tool when new terrorism-linked phone numbers were identified, and suggested that had it been in place before Sept. 11, it might have helped uncover Al Qaeda’s plot. Critics rejected the Sept. 11 argument as exaggerated and portrayed the program as ripe for abuse and as a legally dubious invasion of privacy.

Eventually, the Obama administration and Congress agreed on a reform law that would end the N.S.A.’s bulk collection of domestic calling data, but preserve its ability to swiftly gain access to records held by telecoms when a judge agreed that a specific number had terrorism links. The idea was to reduce the risk of abuse while preserving the analytical capability.

That law — the USA Freedom Act of 2015 — permitted the N.S.A. to build a system linking up with the telecoms under which the agency could retrieve logs of phone calls and texts for a specific suspect, as well as the logs of communications by everyone who had ever been in contact with that suspect — even when they were customers of different phone companies.

Under the old program, the N.S.A. had been vacuuming up billions of logs about Americans’ communications every day. Under the replacement Freedom Act system, that number dropped significantly, although its scale remained large in absolute terms. In 2016, the agency obtained orders to target 42 suspects and collected 151 million records. In 2017, it obtained orders to target 40 suspects and collected 534 million records.

But public signs of trouble with the Freedom Act system began to emerge in June 2018, when the N.S.A. announced that it had discovered “technical irregularities” that caused it to collect more phone records than it had legal authority to gather.

The agency has been coy about the details, saying they are classified, but in broad strokes has said that for various reasons telecoms were returning both accurate and inaccurate numbers in the list of accounts a suspect had been in contact with. When the N.S.A. fed those numbers back into the system to get the “second hop” of calling data from the suspect’s contacts, it compounded the problem.

Unable to separate the good data from the bad, the agency deleted its entire collection of Americans’ phone records — hundreds of millions of communications logs — and started over. But in October 2018, it discovered that the problem was happening again, and, once again, had to purge the data, according to a recently declassified inspector general report.

The recurring headaches, including the inability of the N.S.A. to verify whether the data returned from the phone companies was accurate and the relatively low value of the intelligence that was being gleaned from it, contributed to an intelligence community decision in late 2018 to start winding the program down, officials familiar with the matter have said.

A slightly garbled sign of that move first came to light in March, when a senior Republican congressional aide said in a national security podcast interview, with what was apparently overstatement in terms of the timing, that the N.S.A. had not been using the program “for the past six months.” But for months, the government had refused to say what its status was.

A version of this article appears in print on , Section A, Page 13 of the New York edition with the headline: White House Asks to Reauthorize Surveillance of Americans’ Phone Data. Order Reprints | Today’s Paper | Subscribe