WASHINGTON — A former National Security Agency contractor's theft of top-secret government information was “breathtaking in its longevity and scale,” federal prosecutors said in a court filing Thursday aimed at keeping the Maryland man locked up as the case moves forward.

They said Harold T. Martin III 51, took documents dating from the year he first obtained a security clearance in 1996 and continued until his arrest this year, amassing an archive larger than the haul Edward Snowden is suspected of taking from the intelligence agency headquartered at Fort Meade, Md.

Martin, a Navy veteran who lives in the Baltimore suburb of Glen Burnie, was arrested and charged in August with stealing government documents. Prosecutors said they anticipate filing more serious charges against him under the Espionage Act.

Authorities said they seized some 50 terabytes of digital information — the equivalent of 500 million pages of documents — from Martin's home and car in August. They said the files were scattered across different computers, external hard drives, CDs and USB disks.

The amount of data they said they seized dwarfs the 1.5 million files that authorities say Snowden, also an agency contractor, shared with news organizations in 2013.

The court papers revealed the Justice Department's concern that Martin is or could be in contact with a foreign government.

Prosecutors said Martin has had online communication in Russian and said that if Martin were freed he “could seek refuge with a foreign government willing to shield him from facing justice.”

A detention hearing was scheduled for Friday in Baltimore.

Martin's attorneys said he never intended to betray his country and does not pose a danger or flight risk. They said Martin does not have a valid passport and dismissed as “fantastical scenarios” concerns that he might flee.

One document allegedly in Martin's possession and marked as “Top Secret/Sensitive Compartmented Information” included “specific operational plans against a known enemy of the United States,” according to the court filing.

The information includes an email chain marked as “Top Secret” that appeared to have been printed from an official government account.

On the back of the document, prosecutors said, were handwritten notes describing the NSA's classified computer infrastructure. The notes, which include basic concepts about classified information, appear “intended for an audience outside of the Intelligence Community,” the government said.

Prosecutors also cited Martin's use of technologies designed to encrypt communication and allow for online anonymity. They said Martin, who had been trained in computer security and at the time of his arrest was enrolled in a doctoral program on information security management, appeared to be trying to connect to the internet anonymously using a specialized operating system.

The government was likely referring to Tails, a Linux-based operating system that appears similar to Microsoft Windows — but makes web browsing practically anonymous. It also vanishes once the computer restarts.

Because systems like Tails direct internet traffic through a global network called Tor, it's harder for authorities to trace a user's internet address or capture information about them. The operating system and the Tor network itself are largely used by journalists, activists and others who have a safety interest in keeping their web-browsing habits a secret.

Martin, a former contractor at Booz Allen Hamilton, had access to classified information since 1996, the government said.

His arrest was a further blow to the NSA, coming three years after Snowden — another NSA contractor who also worked at Booz Allen — disclosed to journalists details about government surveillance programs. Snowden, who now lives in Moscow, was charged in his absence under the Espionage Act.

“The evidence is overwhelming that the defendant abused this trust and chose to repeatedly violate his agreements, his oaths and the law — and to retain extremely sensitive government information to use however he wished,” prosecutors said.

The Baltimore Sun contributed.