China and Russia will hold joint naval drills in the Mediterranean Sea for the first time in mid-May, the Chinese defense ministry announced Thursday.

It comes at a time when Russia has been ostracized by most of the international community for its alleged support of pro-Russian separatist rebels in Ukraine.

Nine ships are expected to participate in the "Joint Sea 2015" exercises, three from China and six from Russia, reported Reuters.

"What needs to be stressed is that this joint exercise is not targeting any third party and is not related to regional security," Chinese ministry spokesman Geng Yansheng said, according to Reuters.

"The purpose of the exercise is to strengthen the friendly exchanges between the two sides ... and to improve the capability of the two navies to deal with maritime threats."

Training will focus on rescue, resupply and joint escort, "as well as the actual use and firing of weapons," Geng said.

The two countries have held joint drills in the Pacific since 2012, but this will be the first in the Mediterranean.

Because Moscow has also been sanctioned by the West over its involvement in Ukraine, it's more important than ever for Russia to build closer relationships with Africa, South America and Asia - particularly China.

Beijing refused to condemn Russia for backing Ukrainian rebels, and does not participate in the international sanctions.

China hopes to gain from Russia's vast energy resources and continue receiving advanced equipment, according to Reuters.

On May 9, Chinese President Xi Jinping plans to attend a parade in Moscow celebrating the 70th anniversary of the end of World War II, an event that most Western leaders are shying away from.