For decades, every sign Russia and Japan had made progress in talks on disputed territories and a post-World War II peace treaty turned out to be a false alarm. This time may be different: Both Prime Minister Shinzo Abe Russian President Vladimir Putin need a deal more than their predecessors did.

Putin and Abe met in Singapore last week and agreed to speed up talks on a peace treaty their two countries negotiated after World War II but the Soviet Union refused to sign. The talks will be based on a joint declaration the Soviet Union and Japan signed in 1956 that required the Soviet Union to hand over to Japan the island of Shikotan and the Habomai islets once a peace treaty was signed. Japan has since insisted on the handover of two more islands, Etorofu (Iturup) and Kunashiri (Kunashir), and Russia has refused to cede any territory at all.

Both sides have strong misgivings about a compromise based on the 1956 declaration. For Japan, it would mean losing the leverage to claim much bigger territory (Etorofu and Kunashiri account for 93 percent of the land area of the disputed islands). For Russia, a deal is important (symbolically for the most part) to make sure no U.S. military bases are placed on Shikotan and Habomai, something Abe reportedly promised to Putin but may be unable to rule out under existing Japanese commitments to the U.S.

Besides, the return of any of the islands, seized by the Soviet Union at the end of World War II, is extremely unpopular in today’s Russia. Over the years, polls have consistently shown that 70 percent to 90 percent of Russians reject such a handover. Putin’s predecessor, Boris Yeltsin, was at several points close to ceding some territory to Japan, but he always stepped back, fearing a powerful backlash from Communist and nationalist rivals.

Now, both Abe and Putin really want to put the matter behind them.

Abe’s primary interest is his legacy. If he can keep his job through the end of his term as chief of the ruling party in 2021, he would be the longest-serving Japanese prime minister. But economic growth, spurred by his generous stimulus policies, has started to slow this year, and his tenure isn’t assured. He needs an important win to stay in power and ensure his place in history.

A deal with Russia, though it would face some domestic opposition, could be perceived as such a victory when confidence in Abe’s foreign policy is flagging: Japanese voters are more open to a compromise than Russians.

Putin’s interest is both economic and geopolitical. A deal with Japan would potentially open the flow of Japanese investment to Russia’s Far East, a vast, underdeveloped region where Russia needs to counterbalance a growing Chinese influence.

Improving relations with Japan would also help Putin in his search for alternatives to cooperation with the West. He knows by now that U.S. economic sanctions and weaker European restrictions are here to stay, so he’s working feverishly to buttress other partnerships in the Middle East and Asia.

On Monday, Putin and Turkish President Recep Tayyip Erdogan watched a Russian natural gas pipeline make landfall in Turkey; Japan, too, is a potential customer for Russian pipeline gas, but giant projects like building a delivery system are unimaginable without a peace treaty.

Putin is playing for high stakes, and Shikotan and Habomai, a little more than 259 square kilometers of inhospitable land with a population of about 2,000, wouldn’t be a huge loss by comparison, except politically. The Russian social networks are rife with speculation about a possible handover, and the comments aren’t flattering to Putin. “How loudly we ‘took’ Crimea and how quietly we’re giving up the islands” is a typical sentiment. Putin is being accused of selling Russian land because his regime has mishandled Russia’s windfall from high oil prices in the 2000s.

In recent months, however, Putin appears to have made peace with his falling approval rating. He disregarded public opinion as he pushed through a highly unpopular retirement-age increase. The absence of serious protests must have persuaded him he can make unpopular decisions during what is, according to the Russian Constitution, his last term in power unless he wants to attempt a comeback after a six-year break.

This doesn’t mean he won’t drive a hard bargain on the islands. On Sunday, Putin’s press secretary Dmitry Peskov said accepting the 1956 declaration as a basis for negotiations doesn’t mean “an automatic transfer of any territories.” Russia will likely discuss handing over the islands without losing sovereignty, on the basis of a lease or a joint governance deal.

There will also be demands for firm guarantees that the U.S. will keep away from the islands and that certain Japanese investment projects and energy deals will follow the peace treaty.

Whether Abe can live with any of the Russian demands is uncertain: He can kick the can down the road if the deal doesn’t look like a clear win. But, knowing how difficult it can be, the prime minister has agreed to speed up the talks and hold additional meetings with Putin. It’s still likely that they’ll produce another dud — but less likely than on any previous occasion during Putin’s long rule.

Based in Berlin, Russian writer Leonid Bershidsky is a Bloomberg Opinion columnist covering European politics and business. He was the founding editor of the Russian business daily Vedomosti and founded the opinion website Slon.ru.