BALTIMORE — A former intelligence contractor stole the equivalent of 500 million pages of government documents over two decades of work at seven companies, including top-secret plans for an operation against a hostile country, prosecutors said in papers filed in Federal District Court here on Thursday.

The prosecutors also said that the former contractor, Harold T. Martin III, who worked for the National Security Agency and other military and intelligence agencies, kept an “arsenal” of 10 firearms at home in Maryland, including an assault-style rifle and a loaded handgun that he kept illegally in his car.

Mr. Martin, 51, a computer expert and Ph.D. student, was arrested Aug. 27 after he posted something on the internet that drew the attention of F.B.I. agents investigating the appearance of highly classified N.S.A. hacking tools for sale on the web. The bureau is trying to determine whether Mr. Martin, who is said to have taken the hacking tools home, was the source of the material offered at auction by people calling themselves the Shadow Brokers.

Mr. Martin was initially charged with theft of government property and mishandling of classified information, violations carrying a maximum sentence of 11 years. But the new filing said prosecutors planned to charge him with violating the Espionage Act and committing other felonies, crimes that could put him in prison for decades if he is convicted.