The FBI has secretly arrested a National Security Agency (NSA) contractor suspected of stealing highly classified computer codes used to hack the computer systems of foreign governments including Russia and China, raising fears of another embarrassing intelligence leak to rival the Edward Snowden affair.

Law enforcement and intelligence sources told the New York Times that, like Mr Snowden, the contractor worked for consulting firm Booz Allen, which is behind many of the NSA’s most sensitive cyberoperations. In 2013, Mr Snowden leaked more than 1.5 million documents relating to the agency’s surveillance programmes, including some that targeted US citizens.

The contractor in this case was named in a criminal complaint announced by the Justice Department on Wednesday as Harold Thomas Martin III. Mr Martin, who lives in Glen Burnie, Maryland – around 10 miles from the NSA’s Fort Meade headquarters – has been in custody since his arrest on 27 August, according to the Associated Press.

In a raid on his property that month, authorities searched Mr Martin’s home, two storage sheds and his car, reportedly finding highly classified information there in both physical documents and digital files. He was charged with theft of government property, and with the unauthorised removal or retention of classified documents. Some of the information was classified as “sensitive compartmented” a level higher even than “top secret”.

Mr Martin at first denied having taken the materials, but later admitted that “he knew what he had done was wrong,” the complaint stated. An unnamed administration official told the Times that there is so far little indication that his actions were “politically motivated”, and that he may have taken the documents and digital files before Mr Snowden’s leaks.

The 51-year-old contractor is suspected of stealing the NSA’s “source code” used to break into the computer networks of rival powers such as Russia, China, Iran and North Korea. The news comes as Mr Snowden, who is currently living in Russia, has been arguing for a pardon from the US amid the release of Snowden, a film about his case by director Oliver Stone.