MOSCOW — President Vladimir V. Putin of Russia on Tuesday dashed Japanese hopes of a settlement any time soon to a territorial dispute that has festered since 1945, declaring after a meeting with the visiting Prime Minister Shinzo Abe of Japan that there was still much “painstaking work” ahead.

In his remarks to reporters, Mr. Putin gave no sign that Russia might accede to Tokyo’s demand that it relinquish Japanese islands seized by the Soviet Union at the end of World War II. He said that any agreement must have support from the public, which in Russia, according to a November opinion poll, is strongly opposed to returning any islands to Japan.

Mr. Abe, whose father, Shintaro Abe, spent years trying in vain to settle the territorial dispute with Russia while serving as Japan’s foreign minister, has made improving relations with Moscow a priority. But he, too, conceded on Tuesday that “resolving a problem left unresolved for over 70 years since the end of the war is not easy.”

Mr. Putin had previously raised Japanese hopes of reclaiming at least a small portion of what it calls its “Northern Territories” and what Russians refer to as the Southern Kuriles, a chain of islands off Japan’s northern prefecture of Hokkaido.