The window of opportunity for Russia and Japan to officially end World War II with a peace treaty narrowed again after Prime Minister Shinzo Abe's visit to Moscow on Tuesday failed to end in a breakthrough. There's still time for Abe to secure his legacy, but a lot depends on Russian President Vladimir Putin's increasingly shaky domestic standing.

As I wrote when Putin and Abe met in November (the meeting Tuesday was their 25th), both leaders need a deal more than ever. For Abe, an end to the dispute with Russia over islands the Soviet Union seized from Japan at the end of World War II would be the big win he needs to serve out his term and become Japan's longest-serving prime minister, while potentially driving a wedge between Russia and China, which together present the biggest threat to Japan's security.

For Putin, an agreement with Japan would be both strategically and tactically beneficial. The development of Russia's vast Far East is one of the president's strategic priorities, and he hopes to get Japan's help to counterbalance China's growing role in the region. Putin appears to be out of productive foreign policy ideas, and forging a closer relationship with Japan would offer some exciting opportunities. Negotiating a peace treaty that would include nonaggression guarantees would undermine U.S.-Japanese military cooperation, and could undercut U.S. attempts to isolate Russia economically.