Taiwan’s government has said it will provide assistance to Hong Kong protesters seeking sanctuary, after local media reported dozens of activists involved in an unprecedented storming of the city’s parliament had fled to the island.

The pledge risks infuriating Beijing but comes as Taiwan gears up for a presidential election where a dominating issue will be relations with the mainland – which regards the self-ruled island as its own territory and has vowed to seize it.

More than 30 Hongkongers who fear prosecution for their involvement in the ransacking of the finance hub’s legislature on 1 July have arrived in Taiwan to seek shelter, Taiwan’s Apple Daily said, citing unnamed sources.

The report said the activists were staying in various locations and that some were receiving assistance from local NGOs.

The mainland affairs council, Taiwan’s top policymaking body on China, did not confirm whether any requests for sanctuary had been made.

It issued a statement on Friday saying it would handle such cases “under the principle of respecting human rights protections and humanitarian concerns”.

We “can provide necessary assistance to Hong Kong residents whose safety and freedom are in urgent danger due to political reasons”, it said.

Taiwan’s president, Tsai Ing-wen, added her support for such a move. “These friends from Hong Kong will be treated in an appropriate way on humanitarian grounds,” Taiwan’s Central News Agency quoted her as saying during a visit to the Caribbean island of Saint Lucia, one of Taiwan’s few remaining diplomatic allies.

Hong Kong has been rocked by more than a month of huge and largely peaceful protests – as well as a series of separate violent confrontations with police – sparked by a law that would have allowed extraditions to mainland China and other countries.

Taiwan’s history of providing sanctuary to Chinese dissidents has been mixed. The island does not recognise the legal concept of asylum but has, on occasions, allowed dissidents to stay on long-term visas.

Tsai’s offer comes as she prepares to seek a second term at January’s election. Ties with Beijing have soured since she came to power in 2016 because her party refuses to recognise the idea that Taiwan is part of “one China”.

Since her landslide victory, Beijing has cut official communications, stepped up military exercises, poached diplomatic allies and ratcheted up economic pressure on the island.

Tsai has described the 2020 presidential election as a “fight for freedom and democracy”, setting herself up as someone who can defend Taiwan from an increasingly assertive Beijing.

Her main opponent, Han Kuo-yu – from the more China-friendly Kuomintang party – has advocated warmer ties with the mainland.

Apple Daily said about a further 30 protesters were planning to come to Taiwan later hoping to stay long-term and follow the case set by the Hong Kong bookseller Lam Wing-kee.

Lam, who disappeared into Chinese custody for half a year at the end of 2015, fled to Taiwan in April. He was one of five publishers selling gossip-filled tomes on China’s leaders who vanished, resurfacing in Chinese custody and making televised confessions.

Taiwanese authorities initially granted the 64-year-old a one-month business stay and have since extended it twice to late October.

Lam told AFP he had heard about the Hong Kong anti-government protesters fleeing to Taiwan from his “connections in Canada who are willing to help in case they couldn’t stay in Taiwan”.