BEIJING, July 6 (Reuters) - China hosted two Russian warships that had earlier sailed past Taiwan and Japan, and the vessels are expected to hold a joint drill with the Chinese navy during their visit, demonstrating the enduring military cooperation between the two countries.

The two frigates - Gromkiy and Sovershenniy - made port at the financial hub of Shanghai on Wednesday, Chinese state television reported. Both vessels belong to Russia's Pacific Fleet, headquartered in Vladivostok.

During their seven-day visit, the ships will conduct naval drills with the Chinese navy in Shanghai, that will include practices on formation movements, communication and sea rescues, according to the report.

The same ships, which belong to the Pacific fleet of the Russian Navy, passed through waters near democratically governed Taiwan at the end of June. They later sailed past Japan's Okinawa islands, the site of a major U.S. military base, earlier this month.

The passage prompted Japan to dispatch vessels to monitor their movements while Taiwan, which China claims as part of its territory, deployed an aircraft and also ships to keep watch over their transit.

At the end of China's President Xi Jingping's visit to Moscow for talks with Russian President Vladimir Putin in March, the two leaders issued a joint statement which contained familiar accusations against the West - that Washington was undermining global stability and NATO was barging into the Asia-Pacific region.

China and Russia have pledged stronger military ties, and on Monday, China's Defence Minister Li Shangfu met with the head of the Russian navy, Admiral Nikolai Yevmenov, in Beijing.

And just before that, Russia and China's foreign ministries held a round of consultations on anti-missile defence at end-June.

Last month, the chief of the joint staff department of China's Central Military Commission Liu Zhenli also held talks with Russia's chief of general staff Valery Gerasimov via video link.

Gerasimov was quoted by Tass news agency as saying that the two sides will continue to expand their military cooperation.