Washington: An attack on Taiwan would be a 'strategic mistake' for China, Chairman of the US Joint Chiefs of Staff Gen Mark Milley said on Wednesday, as the strategic rivalry continues to intensify between the two largest economies in the world.

"Attacking and sieging Taiwan across the strait is a difficult task to do. Most of Taiwan is a mountainous island. It's a very difficult military objective....The Chinese would be at high risk and it will be an unwise geopolitical mistake and a strategic mistake similar to what Putin has made in Ukraine," Gen Milley said during a press briefing.

Milley said there are lessons to be learnt from the conflict in Ukraine when it comes to the situation in Taiwan and helping the island prepare to defend itself.

Terming China as a pacing threat, the top US general said Beijing has advanced its objective to become the number one power by mid-century.

During a press conference, Milley said the continued superiority of the US military to China's helps to deter great power conflict between the two nations.

"Right now, the United States military is, without question, despite whatever criticisms people have, the most lethal warfighting machine on Earth, bar none. The United States military is number one and we intend to stay number one," he said while adding "China is not going to be a better military than the United States military is."

General Milley said that as long as the US military remains dominant, it can deter a "great power war" between the US and China.

Earlier this year, the US labeled China the pacing challenge in its national defence strategy. Milley also said China is the greatest geopolitical threat to the US and is not shy about its intention to be the number one global power. "But we will not allow that to happen," he said.

"As long as we remain number one, then we will deter the war that people worry about. The great power war between China and United States," he added.