A US soldier has been jailed for 16 years for attempting to sell military secrets to a woman he thought was a Russian spy, officials said Tuesday.

Military policeman William Millay was also dishonorably discharged as part of a plea deal after admitting charges including attempted espionage and communicating national defense information.

The 24-year-old was arrested in October 2011 after offering to sell information to a woman he knew as Natalia and believed represented the Russian government, but was in fact a Federal Bureau of Investigation (FBI) agent.

He has been held at Joint Base Elmendorf-Richardson in Anchorage, Alaska, where he was sentenced late Monday.

"Millay betrayed his nation's trust by attempting to sell classified national defense information for profit to a foreign nation," said Deirdre Fike, in charge of the FBI's Anchorage office.

"Today he's been held accountable for his actions. We continue to remain vigilant to protect American secrets from those entrusted with their safekeeping who seek to sell them for profit."

Millay pleaded guilty last month to attempted espionage, failing to obey regulations, issuing a false official statement, soliciting another to commit espionage and communicating national defense information.

The charges specifically said he "communicated and transmitted national defense information to an undercover FBI agent whom he believed was a foreign intelligence agent.

He "had access to the information through the course of his normal duties both stateside and on a previous deployment, and believed that it could be used to the detriment of the United States or the advantage of a foreign nation."

"We're disappointed that Specialist Millay chose this path, but hope that his swift arrest and strong sentencing will deter future soldiers from making the same bad choices he made," said a military spokesman, Bill Coppernoll.

"Espionage is dangerous. It can put lives at risk and threatens national security. We work vigorously to identify anyone engaged in it, and prosecute them to the fullest extent of the law."