TOKYO, SEPT. 5 -- After 45 years of frosty relations, Japan and the Soviet Union took a step toward rapprochement today as the two countries' foreign ministers issued a joint communique on the Persian Gulf crisis and agreed to work more closely on Asian-Pacific security concerns.

On the first day of a scheduled four-day visit here by Soviet Foreign Minister Eduard Shevardnadze, he and his Japanese counterpart, Taro Nakayama, said they had made a start toward more congenial relations between the two Asian powers.

The communique itself, condemning Iraq's invasion of Kuwait and calling for the release of foreign hostages, was routine as such diplomatic documents go. But the fact that it was issued demonstrates the changes both countries have in mind in the post-Cold War world.

The Soviets, already rebuilding relations with the United States, are now reaching out toward the Asian economic giant with which it has fought two wars this century. The Japanese, in turn, are looking beyond their traditional obeisance to the United States on international affairs for a more independent course.

Soviet-Japanese relations should get a further boost next spring when Soviet President Mikhail Gorbachev is scheduled to visit Japan. There are already signs of incipient "Gorbymania" among the Japanese, and that trip seems likely to make the Soviet president as popular here as he is in the United States.

The Soviet Union is Japan's nearest international neighbor -- the tip of its Sakhalin Peninsula looms less than 20 miles off the coast of Hokkaido, Japan's northern island. But the two countries have treated each other in unneighborly fashion for most of the century.

Japan defeated the Soviets in the Russo-Japanese war of 1904-5, and the two nations maintained a wary, distant relationship thereafter. They signed a nonaggression pact just before World War II, but the Soviets broke it in the last week of the war and took over four small islands off the Hokkaido coast.

The Soviets are still using those four islands -- known in Japan as the "Northern Territories" -- for military bases, and disagreement over their status has hampered relations.

In today's meetings, Shevardnadze and Nakayama brushed over the territorial dispute. It evidently will be held to one side at least until Gorbachev's trip here. But the two diplomats moved on to declare that their nations can agree on certain international issues.

Specifically, they called on Iraq to withdraw its troops immediately from Kuwait and release all foreign nationals it is holding hostage.

More important, perhaps, was initial agreement to set up a working-level diplomatic forum between the two nations to deal with Asian security concerns. And the two sides discussed a Soviet proposal calling for political and military exchanges.

There are still significant differences between the two Asian powers. Nakayama rejected Shevardnadze's suggestion that Japan replace its current military alliance with the United States by joining a comprehensive security mechanism in the Asia-Pacific region. The Soviet official, in turn, failed to respond to Nakayama's call for unilateral reduction of Russian military power in Soviet Asia and the four islands off the coast of Japan.

But both countries have reasons to move forward from this point.

The Soviets see prosperous Japan as a key source of the financial aid they need for Gorbachev's restructuring of the Russian economy.

Japanese diplomats, in turn, say the possibility of financial help might nudge Gorbachev to give some ground on the disputed islands.