A former National Security Agency contractor pleaded guilty Thursday to stealing classified material over more than 20 years in what may be the largest breach of classified information in U.S. history.

Harold Thomas Martin III, 54, worked for several different companies from 1993 to 2016 that contracted with government agencies. He was given a security clearance to conduct his work, which allowed him to access top secret information.

Martin, a former Navy officer, was arrested in August 2016 when law enforcement agents raided his Glen Burnie, Md., home and found he had stored a massive trove of government documents and digital files in his home and vehicle. He worked for Booz Allen Hamilton at the time of his arrest, the same contractor that employed NSA leaker Edward Snowden.

Prosecutors did not accuse Martin — known as "Hal" — of trying to leak the information, but he came under suspicion as a source for Shadow Brokers, a group that posted tools the NSA used to hack into computers of foreign targets online. Martin had worked for the NSA unit that used the tools.

His attorneys claimed he suffered from mental health issues and was hoarding the data and did not have any intention of harming national security. Prosecutors never found evidence that Martin shared the secrets with anyone.

As part of a plea bargain, prosecutors have requested a nine-year prison sentence. Martin is scheduled to be sentenced July 17.

Another NSA employee was sentenced to more than five years in prison last year after taking home classified materials. Intelligence officials believe Russian hackers stole the top secret information from Nghia Pho’s computer.

Reality Winner, 27, an NSA linguist, was also sentenced last year to more than five years in prison for leaking classified information on Russia’s election interference.