China’s holdings of U.S. Treasuries fell in July to the lowest level in more than three years, as the world’s second-largest economy pares its foreign-exchange reserves to support the yuan.

The biggest foreign holder of U.S. government debt had $1.22 trillion in bonds, notes and bills in July, down $22 billion from the prior month, in the biggest drop since 2013, according to U.S. Treasury Department data released Friday in Washington and previous figures compiled by Bloomberg. The portfolio of Japan, the largest holder after China, rose $6.9 billion to $1.15 trillion. Saudi Arabia’s holdings of Treasuries declined for a sixth straight month, to $96.5 billion.

The figures compare with official Chinese data showing that the nation’s foreign-exchange reserves were little changed in July at $3.2 trillion, though they’re down from a peak of close to $4 trillion in 2014. The reserves dropped $16 billion in August to the lowest level since 2011.

The report, which also contains data on international capital flows, showed net foreign buying of long-term securities totaling $103.9 billion in July. It showed a total cross-border inflow, including short-term securities such as Treasury bills and stock swaps, of $140.6 billion.

Net foreign selling of U.S. Treasuries was $13.1 billion in July, while foreigners scooped up a net $26.1 billion in equities, $20.7 billion of corporate debt and $38.9 billion in agency debt, according to the report.