On the anniversary of China's bloody crackdown on student-led protests in and around Beijing's Tiananmen Square, Taiwan's new president told China on Saturday that democracy is nothing to fear.

Tsai Ing-wen said in a Facebook post on the 27th anniversary that Taiwan could serve as an example to China.

Tsai said in the run-up to Taiwan's elections earlier this year she had seen people from from China, as well as the Chinese territories of Hong Kong and Macau, mixing with crowds in Taiwan.

"These many friends, after experiencing things for themselves can see that in fact there's nothing scary about democracy. Democracy is a good and fine thing," wrote Tsai, who took office last month.

China sent in tanks to break up demonstrations on June 4, 1989. Beijing has never released a death toll but estimates from human rights groups and witnesses range from several hundred to several thousand.

The subject remains all but taboo in China, where President Xi Jinping is overseeing a broad crackdown on rights groups and activists.

Tsai also said in her Facebook post about the Tiananmen crackdown's anniversary that nobody could deny the material advances China had made under the Communist Party.

However, China would win even more respect internationally if it gave its people even more rights, wrote Tsai, who is from Taiwan's pro-independence Democratic Progressive Party.

Taiwan is the only part of the Chinese-speaking world which holds free elections, and Tsai risks upsetting Beijing with her frank remarks on Tiananmen.

China has never renounced the use of force to bring what it views as a wayward province under its control and is deeply suspicious of Tsai. Chinese officials have accused her of pushing the island toward formal independence.

In Beijing, security was tight at Tiananmen Square, with long lines at bag and identity checks. The square itself was peaceful, with hundreds of tourists stopping to take photos in the early summer sun.

While most state media made no mention of the sensitive anniversary, the English version of popular Beijing-based tabloid the Global Times wrote in a commentary that people in China had put the events of 1989 behind them.

"The annual hubbub around the June 4 incident is nothing but bubbles that are doomed to burst."

Tsai said Taiwan understood the pain caused by Tiananmen because Taiwan had similar experiences in its struggle for democracy, referring to repression under the martial law enforced by the Nationalists over the island from 1949-1987.

"I'm not here to give advice about the political system on the other side of the Taiwan Strait, but am willing to sincerely share Taiwan's democratic experience," she said.

People in Hong Kong, which returned to Chinese rule under a deal to preserve wide-ranging freedoms in 1997, will mark the anniversary later on Saturday. It is the only place on Chinese soil where June 4 commemorations are tolerated.