TAIPEI (Reuters) - Taiwan’s parliament passed an anti-infiltration law on Tuesday to combat perceived threats from China as the island gears up for a presidential vote on Jan. 11 amid heightened tension with Beijing.

The legislation is part of a years-long effort to combat what many in Taiwan see as Chinese efforts to influence politics and the democratic process, through illicit funding of politicians and the media and other methods.

The move further strains ties between Taiwan and Beijing, which suspects Taiwan President Tsai Ing-wen of pushing for the island’s formal independence and has ramped up pressure on her since she took office in 2016.

“The rise of China has posed a threat to all countries, and Taiwan is facing the biggest threat,” Chen Ou-po of the majority Democratic Progressive Party (DPP) told parliament after the bill was passed.

“Taiwan is on the frontline of Chinese infiltration and urgently needs the anti-infiltration law to protect people’s rights.”

Lawmakers of Tsai’s DPP backed the bill, which passed 67 to zero, despite opposition criticism of it as a “political tool” to gain votes before the election.

Lawmakers of the main opposition Kuomintang, which favors close ties with China, did not participate in the vote.

China’s policy-making Taiwan Affairs Office, in a statement carried by state media, said the DPP was seeking electoral gain from the move and creating enmity across the Taiwan Strait.

“We sternly warn the DPP, blood is thicker than water for the compatriots from both sides of the strait, who protect and help each other: this is something no force can change,” it said.

The law gives legal teeth to efforts to stop China funding activities on the island, such as lobbying or election campaigns. It carries a maximum penalty of seven years in jail and will take effect after Tsai signs it into law in January.

China claims Taiwan as its territory, to be brought under Beijing’s control by force if necessary. Taiwan says it is an independent country called the Republic of China, its official name.

The Kuomintang has said it supports efforts to protect Taiwan from infiltration, but accused the DPP of rushing through the legislation for electoral gain, calling it a threat to Taiwan’s democracy.

Several Kuomintang lawmakers staged a sit-in protest in front of the speaker’s podium during the parliamentary session, holding signs that read “Objecting to bad law” and “Damaging human rights” while wearing black masks that read “Objection”.

A handful of supporters from pro-China political parties protested outside parliament, calling lawmakers to withdraw what they see as legislation that “ruins” cross-Strait exchanges.

China said last week the DPP was trying to “blatantly reverse over” democracy with the bill. In response, Tsai said it was hypocritical of an autocratic China that lacks democracy, human rights or freedom of speech to use the language of democracy to criticize the proposal.