A Utah man who formerly worked as a defense intelligence officer is accused of spying for China.

Ron Rockwell Hansen, 58, of Syracuse, was arrested Saturday in Seattle just before he boarded a flight to China, authorities said.

The arrest ended a yearslong investigation in which Hansen allegedly claimed to both Chinese and U.S. intelligence officials that he could work as a “double agent,” according to charging documents.

Rockwell is accused of receiving $800,000 from Chinese contacts “while illegally acting as an agent of China,” Assistant Attorney General John C. Demers said in a written statement Monday.

“His alleged actions are a betrayal of our nation’s security and the American people and are an affront to his former intelligence community colleagues,” Demers said. “Our intelligence professionals swear an oath to protect our country’s most closely held secrets and the National Security Division will continue to relentlessly pursue justice against those who violate this oath.”

According to investigators, Hansen worked for the Defense Intelligence Agency (DIA) from 2000 to 2006 while he was a U.S. Army officer specializing in signals intelligence and human intelligence. When he retired from the Army in 2006, DIA hired him as a civilian intelligence case officer.

“As part of the training to become a case officer, Hansen received training in managing assets, deterring surveillance, avoiding detection and handling classified and sensitive information,” agents wrote. He also was fluent in Mandarin and Russian.

While working both with the Army and as a civilian, Hansen had “top secret” security clearance, the highest level for national security information, agents wrote in court documents.

But less than a year after he was hired as a civilian case officer, Hansen resigned to work with H-11 Digital Forensics, a Salt Lake City-based cybersecurity firm headed by his brother Jon.

Ron Hansen was responsible for H-11′s business in Asia, agents wrote. At the company’s Beijing office he partnered with two Chinese citizens, one of whom had “numerous” contacts in Chinese intelligence agencies.

“All I can say is, this is heartbreaking to our family. He’s not involved with us or our customers,” Hansen said Monday.

Investigators grew suspicious as Hansen repeatedly tried to regain access to classified information after he was no longer working with the U.S. government. According to court documents, from 2012 to 2016 he:

• offered to work as a “double agent” against Chinese intelligence agencies

• tried to get rehired at the DIA

• encouraged intelligence officers to use him as a source in China

• tried in 2015 to join the staff of a U.S. representative who served on the House Permanent Select Committee on Intelligence.

Charges don’t identify the U.S. representative Hansen allegedly approached.

Rep. Chris Stewart was the only Utah representative on the 22-member committee at that time. Asked if Stewart’s office was contacted by Hansen, spokeswoman Daryn Frischknecht said, ”This is an ongoing investigation therefore Rep. Stewart has no comment.”

In 2014, the FBI began investigating Hansen, according to court documents. Unaware of the pending investigation, Hansen met several times with FBI agents, purporting to offer his services as a source in China. He told agents that Chinese intelligence officers had tried to recruit him, describing meetings in Beijing tea houses and hotels.

In his overtures to the FBI, Hansen showed the agents reports and other classified materials he had kept from his time with the U.S. government and reiterated that Chinese intelligence agencies would view him as a valuable contact, agents wrote.

Hansen told FBI agents that while he was on a business trip in 2015, two Chinese intelligence agents offered him $300,000 per year for “consulting services,” attending conferences on digital forensics and security technology and researching products, agents wrote. Investigators eventually learned that from 2013 to 2017, Hansen attended U.S. government-sponsored conferences on IT security, sometimes trying to “conceal his attendance” with misleading personal details, and gathering information for Chinese agents, according to court documents.

Hansen received payments in cash, wires and credit card transactions from Chinese sources, investigators said.

In their final meeting with Hansen, in 2015, FBI agents told Hansen not to accept offers to work with Chinese intelligence agencies and to tell U.S. agents if Chinese agents kept contacting him.

After FBI agents told Hansen to report any contacts from Chinese agents, Hansen communicated with people he believed to be Chinese intelligence officers about his efforts to rejoin the DIA, investigators wrote. Some of those communications addressed export-controlled U.S. technology that Hansen is accused of illegally selling in China.

In 2016, U.S. investigators received word from a DIA case worker that Hansen had contacted him and another DIA employee, agents wrote. Hansen, according to the case worker, was seeking information to give to Chinese intelligence officials “to keep stringing them along” while he waited for the FBI to consider his offer to work as a “double agent,” investigators wrote.

The DIA case worker agreed to work for the FBI as a confidential informant, agents wrote. The informant reported that Hansen disclosed he had contact with Chinese intelligence agents and had sold them computer products for which they “grossly overpaid” in cash, according to charges.

In March, Hansen forwarded to the DIA informant what he said were specific requests from the Chinese agents for information about U.S. positions dealing with China and North and South Korea, with particular questions about North Korea, investigators wrote. In April, the informant reported that Hansen had claimed Chinese intelligence officials “might pay up to $200,000 if the [informant] could deliver the ‘China ops plan,’” the operations plan of the U.S. military regarding potential military intervention with China.

On Saturday, Hansen planned a layover at Seattle-Tacoma International Airport, during a flight from Salt Lake City to China, to meet the informant, agents wrote. The informant met Hansen near the airport and brought two classified documents, which Hansen reviewed and took notes on, agents wrote. He suggested the informant should “cut a hole in a nearby tree and hide [the documents] in that location,” agents wrote.

As Hansen was returning to the airport to fly to China, agents arrested him.

Hansen is charged in a 15-count complaint, signed Saturday by Chief Federal Magistrate Judge Paul M. Warner in Utah, with attempting to gather or deliver national defense information to aid a foreign government.

He also is charged with acting as an unregistered foreign agent for China, bulk cash smuggling, structuring monetary transactions, and smuggling goods from the United States.