By Ben Blanchard

BEIJING (Reuters) - It is the near future, and China prepares to strike back after being attacked, loosing off ballistic missiles to take out an aircraft carrier and destroying an airfield as a fighter jet takes off.

The enemy is not named in the animation, released late last month by Chinese internet giant Tencent, but the ship looks a lot like a U.S. Nimitz-class carrier, while the destroyed fighter is clearly a Lockheed Martin Corp F-22.

It may be fantasy, but the clip - viewed more than 60 million times so far - reflects a mood of rising nationalism and confidence among the Chinese public and military.

An assertive China under President Xi Jinping now believes its military has the technology to at the very least make the United States think twice before undertaking any military adventures in what China sees as its backyard.

"Can the United States be certain of getting the upper hand in the event of a showdown with China?" retired Major-General Luo Yuan, now a widely followed military commentator, wrote in June. "China is preparing every day to win a modern war."

Xi visits the United States at end of this month.

Analysts see three potential arenas for such a showdown - the South China Sea, where China has a series of overlapping territorial disputes with its neighbors, the East China Sea, where remote islets are a source of friction between Beijing and U.S. ally Japan, and any conflict over self-ruled Taiwan.

The United States remains by far the world's most powerful military nation and has pledged to keep sailing in what it regards as international waters off China, dedicating some of its most advanced assets to the region.

But China's ostentatious display of some of its latest military hardware at a parade in Beijing last week to mark the end of World War Two underlined its growing might.

A senior U.S. official said that, while the Chinese military build-up of recent years had been of ongoing concern, last week's parade was "more for a showcase effect and not something that has anybody in Washington overly worried".

Story continues

MISSILES ON SHOW

Among the weapons unveiled for the first time at the parade was an anti-ship ballistic missile, the Dongfeng-21D, a still untested weapon designed to destroy an aircraft carrier with one hit.

Also on show were several intercontinental ballistic missiles such as the DF-5B and the DF-31A as well as the DF-26 intermediate range ballistic missile, dubbed the "Guam killer" by defense media because it bolsters China's ability to threaten the U.S. Pacific Ocean base.

Airfields and ports under construction on newly reclaimed Chinese islands in the disputed South China Sea will help China project power far into South East Asian waters.

"We've already basically broken through the first island chain," retired rear admiral Zhang Zhaozhong said in state media this year, referring to the ability to confront the United States close to home around Taiwan.

"Now we need to break through the second and third island chains," he added, meaning being able to challenge the U.S. Navy in the rest of East Asia and then out as far as Hawaii.

Richard Bitzinger, a regional security analyst at Singapore's S. Rajaratnam School of International Studies, said while there was nothing technologically new on show last week, he was concerned at potential Chinese military over-confidence.

"Just because they are developing capabilities that are complicating operations, especially for the Americans, doesn't mean they have won the war already," he said.

PACIFIC POWER

The United States, which under President Barack Obama has pursued a strategy of "rebalancing" towards Asia, is not about to give up its position as the leading naval power in the western Pacific any time soon.

The U.S. Navy says about 58 percent of all of its forces - ships, aircraft, sailors and Marines - are deployed to or home-ported in the Pacific Fleet, including in Japan, Guam and Singapore.

The USS Ronald Reagan aircraft carrier is on its way to Japan and three more American aircraft carriers are home-ported on America's Pacific coast.

A recent Pentagon report also noted significant gaps in Chinese defenses, saying it lacked, for example, a robust anti-submarine warfare capability.

"Having these missiles and being able to use them effectively in a conflict are two very different things," said a Western official in Beijing, citing internal assessments of the missiles on show at the parade, adding it was not clear whether the newest models had even been deployed yet.

Still, China's advances are already causing major headaches in democratic Taiwan, which China claims as its own and has never renounced the use of force to bring under its control. The United States is obligated by law to help Taiwan defend itself.

An unpublished Taiwan Defense Ministry report, seen by Reuters, warned that China's upgraded H-6 bomber, when equipped with anti-ship missiles, would enable China to project power even deep into the Indian Ocean.

The same aircraft type appears in the Tencent animation, firing off missiles that end up taking out the carrier.

"The message China is giving these days is 'we're here and you'd better get used to it'," said one senior Beijing-based Asian diplomat. "The aim is to push the Americans as far away as possible. There can only be one big brother in this region."

(Additional reporting by Michael Martina in BEIJING, Greg Torode in HONG KONG, J.R. Wu in TAIPEI, Phil Stewart and Matt Spetalnick in WASHINGTON and Matt Siegel in SYDNEY; Editing by Alex Richardson)