HONG KONG — The Chinese Navy will hold joint exercises with Russia in the Mediterranean in May, China’s Defense Ministry said Thursday, a further indication of the closer ties between the two countries and of the navy’s increasing ambitions.

Nine ships from the two countries will participate in the drills, including Chinese vessels now on antipiracy patrols in waters off the Horn of Africa, the Defense Ministry spokesman, Geng Yansheng, said at a monthly news briefing in Beijing. The drills will focus on navigation safety, at-sea replenishment, escort missions and live-fire exercises, he said.

“The aim is to deepen both countries’ friendly and practical cooperation and increase our navies’ ability to jointly deal with maritime security threats,” Mr. Geng said. “These exercises are not aimed at any third party and have nothing to do with the regional situation.”

One of China’s main military goals is to develop a navy that goes beyond coastal waters and can travel the world’s oceans, and while military analysts said the drills in the Mediterranean appeared to be modest, they would be the farthest from home the Chinese Navy has done.