A senior Chinese diplomat stationed overseas who led a playboy lifestyle, fathered two children out of wedlock and had affairs with foreign agents has appeared in court on charges of leaking top state secrets.

The Chinese cadre surnamed Zhang, said to be with a ministry responsible for technology, was hauled before a court to face charges for leaking top state secrets to foreign spies and was subsequently given a death sentence with a two-year reprieve in February.

Zhang’s exploits and the betrayal of his country were revealed by state broadcaster China Central Television last week in a name-and-shame program aired during evening prime time.

The program’s aim is to warn officials and the people that China was still “crawling with foreign spies” and that those posted overseas must stay vigilant against seduction and instigation.

CCTV did not mention where Zhang was posted, but unverified posts circulating on WeChat and Weibo claimed he committed treason while working in Vietnam.

There were also claims that his illegitimate children were kept hostage to force him to feed more secrets about China’s diplomacy, the domestic situation as well as the health records of state leaders to foreign agents.

Zhang appears in a televised confession after being charged with leaking state secrets. Photo: CCTV screengrab

The interpreter-turned diplomat was dispatched to Hanoi as early as 1996 and was reportedly recruited by spies who claimed to be officials with the country’s foreign ministry. First, they paid him hefty sums to buy intelligence from China, and later offered him prostitutes.

Zhang kept a number of mistresses throughout his years there and even had two children out of wedlock.

Before he quit his job in 2008, Zhang shipped as many as 5,200 documents overseas that he copied and downloaded from office computers and the ministry’s intranet and investigators found 59 of them contained top secrets and 848 files had confidential information, according to the CCTV report.

Zhang ultimately fell foul of Guangxi’s provincial state security bureau and was nabbed in 2016.

China enacted its anti-spy law in 2014 and in an op-ed by the People’s Daily, the party mouthpiece admitted that China faced a lot of espionage and infiltration.

The paper said “foreign adversaries” were bent on planting moles in the People’s Liberation Army, defense contractors and research institutes to steal information and technology and a growing number of Chinese diplomats, students and workers overseas have been instigated to defect.

Read more: Details emerge on HK biz partner of CIA mole recruited by Beijing

Case of CIA ‘mole’ sheds new light on Hong Kong as spy hub