Beijing has been dumping U.S. government debt to prop up its currency. China uses the dollars it gets from selling U.S. Treasuries to buy the yuan, which has sunk to an 8-year low as the world’s second largest economy slows.China’s huge holdings of U.S. debt fell to $1.12 trillion at the end of October, their lowest level in more than six years, according to U.S. Treasury Department data. Japan held $1.13 trillion.

Both countries offloaded Treasuries during the month, but China dumped far more: its holdings dropped by $41.3 billion, while Japan’s fell by just $4.5 billion.

For years, China spent trillions of yuan buying Treasuries as a way of stopping its currency from getting too strong even as its economy grew rapidly. That made China’s exports more competitive, but it also helped to keep interest rates in the U.S. lower than they would have been

Beijing has been selling some of its enormous stockpile of foreign exchange reserves, much of it U.S. government debt, in order to buy yuan. It wants to avoid a repeat of the sudden plunges in the currency that panicked markets in August 2015 and January 2016.

China’s foreign currency war chest fell to its lowest level in more than five years in November.

Japan isn’t the biggest single holder of U.S. debt. At the last count, the Federal Reserve had about $2.5 trillion.