Agence France-Presse/Getty Images

The National Security Agency repeatedly mishandled a program to collect data on American Internet communications, such as email, according to newly released documents that provide a glimpse into possible reasons that program was shut down in 2011.

The documents underscore a continuing theme of many of the secret court opinions declassified in recent months: systems that are complex and difficult to operate, even for the NSA. Foreign Intelligence Surveillance Court Judge John Bates cites “serious compliance problems” and “frequent failures” to comply with court orders.

The documents were among approximately 2,000 some pages of court orders, opinions, and internal NSA documents released by the Director of National Intelligence Monday evening pursuant to a lawsuit by the American Civil Liberties Union and the Electronic Frontier Foundation, an online rights group…