Surveillance data the National Security Agency vowed to preserve related to pending lawsuits has been erased, and the agency did not take several precautions it told a federal court it would take to ensure the data did not get deleted, court filings reveal.

Court orders from 2007 have required the NSA to maintain the data related to certain surveillance efforts that were under scrutiny, after it was revealed President George W. Bush directed warrantless wiretapping among international communications following the 9/11 attacks. The NSA has provided updates to the court regarding how it has followed the orders.

But the NSA informed U.S. District Court Judge Jeffrey White that the agency did not keep content of internet communications seized from 2001 to 2007 under the Bush administration in a filing Thursday night, and in a submission last year, according to Politico. Additionally, the NSA said backup tapes were deleted in 2009, 2011, and 2016.

“The NSA sincerely regrets its failure to prevent the deletion of this data,” NSA’s deputy director of capabilities, referenced as “Elizabeth B.,” said in a declaration filed in the fall. “NSA senior management is fully aware of this failure, and the Agency is committed to taking swift action to respond to the loss of this data.”

Another NSA official revealed on Thursday the data had been erased during a large effort to create more space for new information.

Violating a court order could mean civil or criminal charges, along with sanctions against those in the wrong.

The news comes after Congress just approved the agency’s legal authority to conduct a significant portion of its surveillance work for six years, known as Section 702 of the Foreign Intelligence Surveillance Act.

Section 702 permits the intelligence community to oversee foreign communications, but does not authorize the government to oversee Americans.