With Russia alienated by the West and China eager to buy high-end weaponry, a joint military pact – though still a long way off – looks increasingly seductive to both.

Russia and China are planning to hold large-scale joint naval drills in the Mediterranean and Pacific next year, as deepening economic and political cooperation appear to be driving the two giants to at least discuss the idea of forming a military bloc.

Both countries are rapidly jacking up their military spending and modernizing their forces. China is set to spend an unprecedented $132 billion of defense this year. Meanwhile, Russia is in the midst of a sweeping five-year $700-billion rearmament program, and has lately begun restoring Soviet-era bomber patrols across much of the West’s airspace. Russian officials say the upcoming naval drills are designed to demonstrate that Russian and Chinese fleets can operate together in bodies of water half a world apart.

It’s still a far cry from the “NATO of the East” that some analysts have been predicting for years. But economic relations between them have taken a quantum leap, with two massive energy deals totaling almost $1 trillion signed in the past few months alone. As Russia digs in for what’s beginning to look like a long-term standoff with the West, and China worries about protecting its back amid growing territorial disputes with US allies on its southern and eastern flanks, Russian officials are for the first time suggesting a permanent security alliance as a desirable goal.

Recommended: Asia’s troubled waters: What’s going on in the South China Sea? Take our quiz.

Military cooperation between Russia and China has “visibly expanded and gained a systemic character” recently, Russian Defense Minister Sergei Shoigu told journalists during a visit to Beijing this week.  Both sides are increasingly concerned “over US attempts to strengthen its military and political clout in the Asia-Pacific region,” he said. Hence, “we believe that the main goal of pooling our efforts is to shape a collective regional security system.”

Should it ever be created, such a bloc would dominate the Eurasian landmass, with naval bases from the Baltic, to the Arctic, to the Pacific, to the South China Sea. A union between Russia’s cutting-edge weaponry and China’s vast population and industrial base might spawn an armed juggernaut that could eventually rival NATO.

Many analysts argue that the underlying tensions and history of acrimony between the two giants precludes a stable military alliance between them. But a few are suggesting that current pressures – Western sanctions and efforts to politically isolate Russia on one hand, and China’s growing territorial ambitions on the other – are pushing Moscow and Beijing into each other’s arms and making a joint military pact look increasingly seductive to both.

“At the moment things are drifting in that direction. Russia has gotten into a position that makes it much more interested than it ever was before in seeking the security of a bloc,” says Alexander Salitsky, an expert with the official Institute of World Economy and International Relations in Moscow. “Whether we like it or not, a new bipolarity is emerging in the world. There is already a measure of political and diplomatic coordination between Russia and China, and this seems to be growing.”

China and Russia have a mutual interest in policing former Soviet central Asia, where they compete for resources but share common worries about the spread of Islamist-inspired terrorism. Both are leaders of the Shanghai Cooperation Organization (SCO), the only major international organization that neither the US nor any of its allies belongs to. The six-member SCO, founded in 2001 to coordinate economic development in central Asia, has since worked to oust the US from its own military bases in central Asia. It has also increasingly  taken on a security role as the withdrawal of NATO forces from Afghanistan looms closer.

But joint naval drills on the world’s far-flung oceans suggests a broader agenda emerging in Moscow and Beijing. Analysts say their goals are different but, at least for now, complementary.

“Russia’s intent is mainly political, it wants to play the ‘China card’ against the West,” says Sergei Lukonin, a leading Russian China expert. “One major reason China is going along is that it hopes to obtain Russian military technology. It’s using the situation to get what it wants, and seems to be succeeding.”

Until this year Russia has resisted selling its most modern weapons to China, largely out of fears that the Chinese will reverse-engineer them and sell the knock-offs more cheaply on global arms markets. But Moscow now seems willing to supply China with its newest fighter plane, the multi-role Su-35, as well as its most modern air defense system, the S-400.

“To create a military-political alliance is a Russian aim, not a Chinese one,” says Mr. Lukonin. “Whether it eventually comes to pass or not depends on how long this sanctions war between Russia and the West goes on. If things normalize soon, it will be forgotten. If tensions with the West go on a long time, it could happen.” But he adds that “Russia will have drop any illusions it has and get used to the idea that China would be very much the dominant partner in the relationship.”