The fluent Mandarin speaker, Kevin Mallory had served in the US army. (Representational)

An ex-CIA officer was sentenced to 20 years in prison Friday for spying for China in a case called part of an "alarming trend" in the US intelligence community.

Kevin Mallory, 62, was convicted under the Espionage Act for selling classified US "defense information" to a Chinese intelligence agent for $25,000 during trips to Shanghai in March and April 2017.

"Your object is to gain information, and my object is to be paid," he told the Chinese agent in a May 5, 2017 message.

The fluent Mandarin speaker had served in the US army, then as a special agent for the security service of the State Department, before becoming a covert case officer for the Central Intelligence Agency.

Mallory is one of several US officials with high-level security clearances arrested and charged over unsanctioned dealings with Chinese intelligence.

Former Defense Intelligence Agency official Ron Hansen faces 15 years in prison after pleading guilty in March to charges of attempting to sell classified information to the Chinese.

In April, a former diplomat, Candace Marie Claiborne, pleaded guilty to lying to investigators about money she received from Chinese intelligence agents in exchange for US documents.

And in the most significant case, on May 1, former CIA officer Jerry Chun Shing Lee pleaded guilty to spying for China.

Lee, 54, faces a possible life sentence. Arrested in January 2018, he was suspected of having provided Beijing the information it needed to bring down a CIA network of informants in China between 2010 and 2012.

"This case is one in an alarming trend of former US intelligence officers being targeted by China and betraying their country and colleagues," Assistant Attorney General John Demers said of the Mallory case.

"This sentence, together with the recent guilty pleas of Ron Hansen in Utah and Jerry Lee in Virginia, deliver the stern message that our former intelligence officers have no business partnering with the Chinese, or any other adversarial foreign intelligence service."