China's President Xi Jinping has warned that foreign powers will "get their heads bashed" if they attempt to bully or influence the country.
He delivered a defiant speech at an event marking the centenary of the ruling Communist Party on Thursday.
Mr Xi also said Beijing would not allow "sanctimonious preaching", in remarks widely seen as directed at the US.
It comes as China faces criticism over alleged human rights abuses and its crackdown in Hong Kong.
Relations between the US and China have worsened in recent times over trade, espionage and the pandemic.
The issue of Taiwan is also a major source of tension. While democratic Taiwan sees itself as a sovereign state, Beijing views the island as a breakaway province.
The US, under its own laws, is required to provide Taiwan with the means to defend itself should Beijing use force to take the island back.
On Thursday Mr Xi said China maintains an "unshakeable commitment" to unification with Taiwan.
"No one should underestimate the resolve, the will and ability of the Chinese people to defend their national sovereignty and territorial integrity," he said.
In response, Taiwan said it was determined to defend its sovereignty and democracy.
"Beijing should introduce democratic reforms, such as party competition, and respect for human rights while behaving as a responsible regional player," the island's Mainland Affairs Council was quoted as saying by the Taiwan News website.
The 100th anniversary celebrations on Thursday morning saw military jet fly-pasts, cannon salutes and patriotic songs played.
A carefully vetted crowd were in attendance in Beijing's Tiananmen Square, many of whom were not wearing masks.
The country has seen a media blitz in recent weeks promoting a party-approved version of China's history.
Hong Kong is also marking its handover anniversary on the same day.
What stood out in Xi's message?
Mr Xi, who spoke for around an hour, reiterated the role of the party in modern China, saying that it has been central to the country's growth and that attempts to separate it from the people would fail.
"Only socialism can save China, and only socialism with Chinese characteristics can develop China," he said, referring to the system under which the party embraced markets to reform the economy.
He added that "we will never allow anyone to bully, oppress or subjugate China".
"Anyone who dares try to do that will have their heads bashed bloody against the Great Wall of Steel forged by over 1.4 billion Chinese people," he said.
China has repeatedly accused the US of trying to curb its growth - and these comments are also seen as a reference to Washington.
On Hong Kong and Macau - which he said both retain a "high degree of autonomy" - they should "accurately implement the principles of 'one country, two systems'", which underpinned the deal for Britain and Portugal to return the territories to China.
Xi Jinping, modern China's most powerful leader since Mao Zedong, wore a light grey suit which appeared to be identical to the one worn by the Communist Party founder in the famous portrait that adorns one side of Tiananmen Square.
Mr Xi praised his people for the "new world" he said they had created.
What he was also saying was that this is a world that could not have come into being without the Party.
At one point military jets flew over the crowd in formation of the number 100; flown by pilots loyal to the Party and the people.
It's easy to forget when you live here but a key part of the Communist Party strategy has been to try to morph the Party and the machinery of government and the perception of the nation of China into one.
They attribute any success, progress, advancement - and there has been phenomenal economic advancement - to the people and the government but most of all the Party.
Just to make sure the message went out loud and clear, at the end of the ceremony, the crowd sung a song called "Without the Communist Party There Would Be No New China".
How did China prepare for this anniversary?
The Chinese Communist Party (CCP), which was founded in 1921, came to power 72 years ago after a long civil war.
In that time the country has undergone massive changes - but some of these milestones were conspicuously missing in the propaganda drive.
On Monday, an art performance titled The Great Journey was staged at the Bird's Nest stadium in Beijing, where performers put on extravagant set-pieces detailing the history of the party and country.
But significant events such the Cultural Revolution purges, the 1989 Tiananmen Square protests, and the pro-democracy protests in Hong Kong were missing, reported AFP news agency.
Since April, Chinese cinemas were ordered to screen propaganda films, known as "red films", at least twice a week.
A song, called 100%, that praised China's achievements and featured 100 rappers was also released.
"Red tourism" has also become popular, with travel companies such as Ctrip launching 100 unique routes for "red pilgrims".
But not all were pleased with the propaganda.
"Now when I turn on the TV at night, dozens of stations are airing dramas about revolutionary wars," a Beijing resident told BBC Chinese.
Reporting by Waiyee Yip and BBC Chinese