Last week Philippines president Rodrigo Duterte broke with tradition by making a state visit to China before making one to the United States. He also managed to snub Japan with the trip.

Though he’s visiting Japan this week, from Oct. 25 to 27, originally Duterte had scheduled Tokyo to be his first state visit to a major country. The Japanese “were really glad that they were considered as the first outside-ASEAN visit,” noted Richard Javad Heydarian, a political scientist at De La Salle University in Manila.

Japan is the largest source of foreign direct investment into the Philippines, which has overtaken Thailand and Vietnam as the investment destination of choice among Japanese companies deploying a “China plus one” strategy to cope with rising labor costs in China. Japan is also the largest export market for the Philippines.

But Japan’s pleasure turned sour when Duterte later scheduled a trip to Beijing ahead of the one to Japan. That was a “huge disappointment for the Japanese,” said Heydarian, and left them feeling “a little bit snubbed.”

“The very fact that he chose China ahead of the US, and bogged down a scheduled visit to Tokyo in favor of Beijing, that says a lot about the pecking order of his strategic priorities,” said Heydarian. “The symbolics, the optics are astonishing.”

The prospect of Beijing gaining more influence over Manila no doubt unsettles Tokyo, with maritime tension between Japan and China running high. In recent years the Philippines has led the charge against China’s growing aggression at sea. In 2013 the Philippines opened a case in an international tribunal in the Hague, after China seized a strategic reef off its coast and prevented it from exploring for oil within its own exclusive economic zone. But by the time the Philippines won that case in a ruling issued in mid-July, Duterte was about 45 days into power.

Since then, Duterte has shown little interest in leveraging the victory against China (by rallying international pressure to abide by it, for instance). Indeed last week he suggested the ruling was nothing more than a “piece of paper with four corners,” and he announced his “separation” from the United States, all the while acting like a perfect statesman as China rolled out the red carpet for him.

In recent years China has been positioning itself to be able to exert more control over the South China Sea, for instance by building militarized islands atop reefs. For Tokyo the waterway represents the cheapest, most direct way for importing energy supplies from the Persian Gulf, and other commodities from elsewhere. As a nation with few natural resources, Japan has a clear interest in keeping sea routes open—and little interest in seeing the sea become a “Chinese lake,” as some analysts warn of happening.

Japan has every reason, in other words, to keep Duterte on its side, despite the snub. Indeed the Philippine leader looks set to win a bonanza in aid and loans from Tokyo this week, especially for the economic development of Mindanao, the large southern island where he served as mayor of Davao City for many years.

Whatever Japan gives him, though, his romance with China will likely intensify. In recent days he invited Chinese president Xi Jinping to visit the Philippines “at a convenient time.” Xi readily accepted the invitation.