When Japan recently published its new defence white paper which identified the "growing assertiveness" of China as the country's most serious threat, it expected a negative response from Beijing.
But Tokyo officials were pleasantly surprised by words of encouragement from neighbouring Russia.
For Prime Minister Shinzo Abe, who invested a great deal in improving relations with Russia, this is good news, proof that Japan retains plenty of options in its diplomatic showdown with China. And further friendly noises are expected when Mr Abe visits Russia next month.
Relations between Russia and Japan have always been rocky. More than seven decades after the end of World War II, both sides have yet to sign a peace treaty because of a simmering dispute over four islands which Russia seized in 1945 and Japan still claims as part of its territory. However, none of this has dampened Mr Abe's enthusiasm for forging a new partnership with Russia.
One reason for this is purely practical. Japan is interested in becoming a major player in Russia's market, and in gaining a major stake in its Siberian oil and natural gas fields. A decade ago, Moscow evicted Japanese companies from these energy projects. But today, as Russia lacks capital and the deep sea drilling technology often required to exploit fields in inhospitable environments, a partnership with Japan makes perfect sense for both sides.
For Mr Abe, however, the biggest potential advantage is strategic: A close link with Russia offers Japan a further lever against China and increases Japan's diplomatic room for manoeuvre in Asia.
A thaw in relations with Moscow is also supported by Japanese security planners aware that Tokyo's current military deployments, which concentrate large numbers of ground troops and tanks in the northern parts of Japan facing Russia, are a relic of the Cold War and a waste of resources in the confrontation which really matters to Japan today: that with China.
Over the past few years, events have conspired against a thaw. Oil prices collapsed, making collaborative energy projects uneconomical. Russia's military intervention in Ukraine forced Japan to join the Western- led sanctions against Russia. Growing international isolation pushed Russia to move closer to China, precisely what Mr Abe sought to avoid. And Russia's nationalist agenda precluded any compromises over disputed territories.
These obstacles remain. Mr Abe failed to persuade his counterparts in the Group of 7 industrialised nations to lift economic sanctions on Russia. And next month, China and Russia will stage a maritime drill in the South China Sea, proof that their military links remain strong.
Still, it is obvious Russia is now also keen to improve ties with Japan. After the white paper was released, Russia's Sputnik news agency ran a commentary praising Japan's "conciliatory" approach and quoted an expert from Moscow's influential National Research Institute of World Economy and International Relations who pointedly refuted Chinese claims that Japan is engaged in confrontation.
"The white paper is not a unilateral reference to threats from China, but an attempt to encourage China to engage in dialogue," said Ms Kristina Voda, the expert.
Officials in Moscow have also revived plans for a joint "power bridge" project.
Russian Economic Development Minister Alexei Ulyukayev's recent visit to Tokyo brought more ideas for cooperation.
All these initiatives appear to confirm Mr Abe's long-held belief that Russia wishes to use Japan to counterbalance growing Chinese regional influence. There are also signs that President Vladimir Putin is increasingly irritated with China's economic pre-eminence in Central Asia, and may welcome investments from countries such as Japan.
Either way, the next few months will see febrile diplomatic action in Russian-Japanese ties. Mr Abe is scheduled to visit Vladivostok next month and Mr Putin plans to go to Japan by the end of the year.
In public, Mr Abe will have to play down his enthusiasm for Russia, if only in order not to annoy the United States and Europe.
But the mood of anticipation among Japanese officials dealing with Russia is now palpable.