Japan is leaving China behind as Asia’s two largest stock markets compete for investor capital, with the latter’s prospects clouded by long-running concerns about economic growth and geopolitical tensions with the West.

Foreign buying of Japanese equities has exceeded that of Chinese peers for the first time since 2017, according to a Goldman Sachs Group report, which cited data for the first six months of the year. Long-only managers continued to sell stocks in China and Hong Kong on a net basis in July despite a sharp rally, while buying shares in Japan, strategists at Morgan Stanley wrote in a report last week.

The tide has turned in favor of Japan as global funds pile into a market they once shunned due to concerns over lackluster earnings growth. Optimism is running high even after the Bank of Japan adjusted its accommodative stance, as investors seek alternatives to Chinese equities amid a lack of conviction that Beijing’s pledges to support a faltering economy will bear fruit.