At the time of his recruitment, prosecutors said Mr. Mallory was in debt and behind his mortgage, making him an attractive target for Chinese intelligence. In 2017, he twice traveled to China, where an intelligence operative gave him a phone so they could communicate covertly. The F.B.I. later found classified documents on the phone, including at least two that had been successfully transmitted. Prosecutors said one of the documents “contained unique identifiers for human sources who had helped the United States government.”

Mr. Mallory’s case is among a spate of recent ones involving former American intelligence officials who had been recruited by the Chinese. In 2018, the F.B.I. arrested Jerry Chun Shing Lee, another former C.I.A. officer, who had repeated contacts with Chinese intelligence. He pleaded guilty in May to conspiring to spy for the Chinese. Mr. Lee also could face life in prison, but as part of the plea deal prosecutors will seek a sentence of 17 to 27 years.

In another case, Ron Rockwell Hansen, a former contractor for the Defense Intelligence Agency, is likely to spend 15 years in prison. He had met regularly with Chinese intelligence operatives in China, receiving hundreds of thousands of dollars. The F.B.I. began investigating his activities in 2014 and arrested him after a highly controlled operation. He pleaded guilty to attempted espionage and is scheduled to be sentenced in September.

Like Mr. Hansen, Mr. Mallory had been employed by the Defense Intelligence Agency. Defense lawyers for Mr. Mallory had tried to say the cases were similar but prosecutors disagreed.

“The first, and most crucial, difference between Hansen and defendant is that Hansen accepted responsibility for his actions — and did so without delay,” prosecutors said in a court filing this year. “Conversely, to this day, defendant has yet to accept any responsibility whatsoever for his actions.”