TOKYO — When Prime Minister Shinzo Abe of Japan traveled to Darwin, Australia, on Friday and joined his Australian counterpart, Scott Morrison, to lay wreaths at a memorial commemorating the 250 people killed by Japanese bombs there during World War II, it was more than a moment of reconciliation between a wartime aggressor and its victims.

The gesture, which took place at the beginning of Mr. Abe’s daylong visit to Australia, represented Japan’s effort to cement a relationship between two allies as it faces perilous headwinds closer to home.

Arriving in Australia after two days in Singapore for a summit meeting of the Association of Southeast Asian Nations, Mr. Abe demonstrated that Japan was determined to strengthen ties with its prosperous neighbor to the south.

Taking sides is a delicate balancing act in Asia right now, as the influence of the United States under President Trump is waning, and China’s power continues to rise. At the summit in Singapore, Mr. Abe sought to shore up relations with Southeast Asian countries that are increasingly turning to China for economic aid and investment.