Harold T. Martin III began taking classified government files almost 20 years ago so he could get better at his job, his lawyer said in court Friday.
But at some point, federal public defender James Wyda said, he lost control of his stealing. Over two decades, authorities say, he amassed an astonishing 50 terabytes of information.
"This was the behavior of a compulsive hoarder," Wyda said in U.S. District Court in Baltimore.
Martin, a 51-year-old former National Security Agency contractor from Glen Burnie, was charged in August with stealing government property and taking classified information.
Wyda, trying Friday to persuade a federal magistrate judge to release Martin from jail pending a trial, characterized him as a man dedicated to public service.
Magistrate Judge A. David Copperthite was unconvinced. He ruled that Martin was a flight risk and had to remain locked up.
Wyda said outside the courthouse that he would appeal the ruling.
It was Martin's first public court hearing since his arrest in August.
The former Navy officer walked into the courtroom in a two-tone gray jumpsuit and flashed a quick salute to his wife, Deborah Shaw, and other supporters sitting behind him. He didn't address the judge.
Martin has not denied the theft. Federal prosecutors have called the haul "breathtaking" in scope, and Friday's hearing underscored how unusual the case is.
There's no evidence that Martin, known as Hal, shared the documents with anyone, and Wyda said it was wrong to compare him with others who have made off with classified information.
"He's not Edward Snowden," Wyda said, referring to the former NSA contractor who stole secrets from the agency and shared them with journalists. Martin had no political motivation to take the documents, Wyda said, and was not driven by greed as other spies have been.
Martin joined the Navy in 1987 and was sent to train as an officer in Newport, R.I. It was there that he met his first wife, Marina Martin.
Marina Martin, speaking Friday to The Baltimore Sun, remembered her ex-husband as tall, handsome and committed to the Navy.
"He was very enthusiastic. He was really eager to serve," she said. "What he did in the Navy came first."
The couple dated for about a year before they married, Marina Martin said. They had been married only a few weeks before Harold Martin was assigned to the fast combat support ship USS Seattle and sent to the Middle East to take part in the 1991 Persian Gulf War.
Martin left active naval service in 1995 and moved to the Washington area. He and Marina Martin soon divorced — amicably, she said. Marina Martin said she remained in touch with her ex-husband, but had not seen him for the past five years and had no idea about his alleged thefts beyond what she'd read in news coverage.
"When we were together, he didn't seem the type of guy who was against the USA or the military," she said. Marina Martin declined to say whether Harold Martin was involved in hoarding when they were together.
Wyda said the thefts of government files began in 1998, after Martin took the first of several jobs working for contractors.
Martin was trying to get a better understanding of the nation's sprawling security apparatus, Wyda said. But he couldn't stop stealing, Wyda said, and it "became a compulsion."
Assistant U.S. Attorney Zachary Myers said investigators seized more than 50 terabytes of data from Martin's property — the equivalent of half a billion pages of documents.
When federal agents arrived at Martin's home with a search warrant in August, Myers said, he was walking to his car carrying a portfolio stuffed with classified documents.
It's not clear whether Martin had reviewed the documents himself. Wyda said many of them were left in an unlocked shed on his property, covered in dust.
Shaw, Martin's current wife, has been trying to help him control his hoarding impulses, Wyda said.
In a court filing, prosecutors said Martin drafted a message to colleagues in 2007 in which he called them clowns and criticized the government's internal security measures — a tone that prosecutors argued raised questions about how Martin would behave if he were released.
But Wyda read another section from the message, in which Martin called his colleagues "cousins" and commended them on their work.
"I and a lot of other Americans are depending on you to do your jobs right," Wyda read.
Both tones are reflected in messages sent from his email address to public groups about computer security. In some he expresses enthusiasm about ideas other people propose, while in others he appears haughty and dismissive.
"Okay, I was being facetious earlier with the 'COOL' comment," one message reads. "This is a very bad idea."
Copperthite said those differing sides to Martin gave him pause. He said Martin appeared to have mental health problems and struggled with binge drinking.
"We have a person here who may be two persons," Copperthite said.
As Martin was led away in handcuffs, Martin mouthed something to his supporters.
Outside the courthouse, Shaw was asked if she had anything to say.
"I love him," she said. "That's it."