WASHINGTON (Reuters) - A former U.S. National Security Agency contractor has agreed to plead guilty to stealing classified information, according to court filings on Wednesday, in what may have been the largest heist of U.S. government secrets in history.

An undated aerial handout photo shows the National Security Agency (NSA) headquarters building in Fort Meade, Maryland. NSA/Handout via REUTERS

Harold Martin is scheduled to plead guilty to one count of willful retention of national defense information at a federal court in Baltimore on Jan. 22, according to the filings.

Prosecutors said Martin, who was indicted last February, spent up to 20 years stealing highly sensitive government material from the U.S. intelligence community related to national defense, collecting a trove of secrets he hoarded at his home in Glen Burnie, Maryland.

Authorities said they seized 50 terabytes of data from Martin’s home, which officials said could be the biggest theft of classified information in U.S. history.

The government has not said what, if anything, Martin did with the stolen data.

He faces up to 10 years in prison on the single count. Martin has not struck a plea deal with prosecutors and could still be tried on the remaining 19 counts in the indictment, the court filings said.

A lawyer for Martin did not immediately respond to a request for comment.

The NSA has been hit by a series of damaging data breaches in recent years.

In December, former NSA employee Nghia Hoang Pho pleaded guilty to illegally taking classified information that an intelligence official said was later stolen from his home computer by Russian hackers.

Martin worked for Booz Allen Hamilton Holding Corp when he was taken into custody in August 2016.

Booz Allen also employed Edward Snowden, who leaked a trove of secret files to news organizations in 2013 that exposed vast domestic and international surveillance operations carried out by the NSA.

Martin was employed as a private contractor by at least seven companies, working for several government agencies beginning in 1993 after serving in the U.S. Navy for four years, according to the indictment.

His positions, which involved work on highly classified projects involving government computer systems, gave him various security clearances that routinely provided him access to top-secret information, it said.

The indictment also alleged that Martin stole documents from U.S. Cyber Command, the CIA and the National Reconnaissance Office.