Charles Harvey Eccleston pleaded guilty in federal court in Washington on Tuesday. Eccleston was detained last year in the Philippines and then deported.
Prosecutors say Eccleston attempted "spear-phishing" emails to dozens of Energy Department email accounts. That's a technique in which hackers send targeted, legitimate-looking emails that when opened can launch malicious software onto a recipient's computer network.
Prosecutors say the goal was to extract sensitive information related to nuclear weapons that could then be collected by a foreign country.
Court papers say Eccleston came to the FBI's attention after he entered a foreign embassy and offered government email addresses in exchange for money.