China will not allow itself to be bullied and those who try face "broken heads and bloodshed in front of the iron Great Wall of the 1.4 billion Chinese people", President Xi Jinping has said.

Speaking at a mass gathering to mark the centenary of the ruling Communist Party, Mr Xi emphasised the party's role in bringing China to global prominence and saying it would never be divided from the people.

Wearing a grey buttoned-up suit of the type worn by Mao Zedong, Mr Xi spoke from the balcony of Tiananmen Gate as he said China had restored order in Hong Kong following anti-government protests in the semi-autonomous city in 2019.

He also reiterated Beijing's determination to bring self-governing Taiwan under its control.

He received the biggest applause, however, when he described the party as the force that had restored China's dignity after taking power amid civil war in 1949.

"The Chinese people are a people with a strong since of pride and self-confidence," Mr Xi said.

"We have never bullied, oppressed or enslaved the people of another nation, not in the past, during the present or in the future."

"At the same time, the Chinese people will absolutely not allow any foreign force to bully, oppress or enslave us and anyone who attempts to do so will face broken heads and bloodshed in front of the iron Great Wall of the 1.4 billion Chinese people," Mr Xi said.

He did not say what those forces were, but China is enmeshed in a deepening rivalry with the United States for global power status and has clashed with India along their disputed border.

China also claims unpopulated islands held by Japan and almost the entire South China Sea, and it threatens to invade Taiwan, with which the US has boosted relations and military sales.