(CNN) Former NSA contractor Harold "Hal" Martin, accused of the largest known security breach in US intelligence history, pleaded guilty in federal court on Thursday to one count of willfully stealing classified information.

He admitted to taking a 2014 National Security Agency leadership briefing that's classified as Top Secret. The government has agreed to drop 19 similar counts at Martin's sentencing hearing in July.

Martin, 54, spent 23 years working as a contractor for companies hired by the US, particularly on jobs with the NSA. His defense counsel has consistently maintained that Martin took files home because he was a hoarder -- the FBI said it found more than 50 terabytes of government files in drives at his home and in his car -- and that he did not intend to leak them.

In a statement, Martin's defense team led by Richard Wyda, said that the "plea is an affirmation of what Mr. Martin and his defense team have maintained from the beginning of this case. His actions were the product of mental illness."

Wearing a striped gray and charcoal shirt with "inmate" scrawled across the back, Martin entered the court about 10 minutes before the judge. He sat between his attorneys, quietly conferring with them before the hearing began.

Read More