A sharp rebound in global equities after unprecedented stimulus from the the Federal Reserve in March has spurred the biggest shift in Japanese fund flows in seven years.

Investors in Japan sold foreign shares worth ¥3.91 trillion ($37.7 billion) in the six months ended Sept. 30, the latest balance-of-payments data showed — the most since 2013.

They bought ¥11.8 trillion of the nation’s sovereign debt, also the biggest amount in seven years, according to figures from the Japan Securities Dealers Association.