Lawmakers in Taiwan voted on Tuesday to amend existing laws to enforce heavier penalties against anyone – locals, Hongkongers or mainland residents – who leak state secrets or spy for Beijing.

Previous anti-espionage legislation only targeted Taiwan residents, so the loophole had to be plugged to ensure that people from the mainland, Hong Kong or Macau can also be punished appropriately for spying, according to Taiwan’s Legislative Yuan.

The move comes after a spy from the mainland was arrested and identified as a People’s Liberation Army intelligence officer. The defendant, surnamed Zhen, reportedly got more than 10 military officers to form a spy ring. But he only received a four-year jail term from a local court.

The new amendment will extend penalties to include the death sentence or life imprisonment for Chinese nationals as well as residents of Hong Kong and Macau who steal Taiwan’s state or military secrets.

Also, amendments to the Criminal Code and the Classified National Security Information Protection Act will extend prison terms to anyone who leaks state secrets to China, Hong Kong, Macau or other hostile foreign forces from three to 10 years, instead of the current penalty of one to seven years.

There will also be a two-year jail term for those conspiring to leak secrets.

Another amendment to the act will authorize agencies handling confidential information to extend the current three-year travel restriction on former senior leaders and military officers to as long as six years.

A 2016 file photo shows former Taiwanese president Ma Ying-jeou with his successor Tsai Ing-wen. Photo: Handout

The background of the extended ban is the travails between the former and the incumbent leaders of the self-ruled island.

Shortly after he stepped down in 2016, former Taiwanese president Ma Ying-jeou, of the Beijing-friendly Kuomintang party, was barred at the last minute from leaving the island for Hong Kong, his birthplace, to address an international symposium.

Ma’s successor Tsai Ing-wen, of the pro-independence Democratic Progressive Party, insisted the travel restriction was made on national security grounds.

But DPP lawmakers who endorsed the bill to further extend the ban said the amendment was not meant to obstruct anyone from visiting a foreign nation, but to bolster national security.

Had it not been for the extension, Ma would have already been able to go abroad under the existing legal framework.

He said in January during an interview that he hoped to visit China later this year and would not rule out the possibility of meeting with President Xi Jinping for a second time. The two, in capacities as the party bosses of the KMT and the Communist Party, held a historic meeting in Singapore in November 2015.