The Bush administration temporarily shut down its bulk collection of email logs after Justice Department lawyers raised legal concerns in March 2004. Judge Kollar-Kotelly declared the collection lawful in July 2004, according to documents leaked by Edward J. Snowden, the former N.S.A. contractor.

The email metadata — information like the identities of senders and recipients and the dates of messages, but not the content — was used in searches of unknown associates of terrorism suspects. The Obama administration has said it shut down the email metadata program in 2011 for “operational and resource” reasons.

Several other court documents released on Monday indicated that the program had difficulties with collecting Internet communications beyond the scope of what the court had authorized. Redactions made it difficult to understand the specifics of the problems, but an accompanying statement offered more details. At one point, it said, the government had shut down the program for several months “because of the significance and complexity of these incidents.”

The New York Times reported in 2009 that the N.S.A. had intercepted private email messages and phone calls of Americans on a scale that went beyond broad legal limits. A statement released on Monday said that an excess collection problem in 2009 was the result of “longstanding compliance issues associated with N.S.A.’s electronic communications and telephony bulk metadata collection programs” and that the N.S.A. “recognized that its compliance and oversight structure had not kept pace with its operational momentum.”

In a statement, James R. Clapper Jr., the director of national intelligence, said that with the new releases, nearly 2,000 pages about surveillance matters had been declassified since President Obama instructed him in June to “make public as much information as possible about certain sensitive programs while being mindful of the need to protect sensitive classified intelligence activities and national security.”