Move over, Beijing. Japan now owns more U.S. government debt than any other country, ending China's six-year run as the top foreign holder of U.S. Treasuries.

Data from the Treasury Department released Wednesday show that Japan owned $1.2244 trillion worth of U.S. government securities at the end of February, compared to $1.2237 trillion for China.

Both countries unloaded U.S. debt during the month of January, but China sold more, making Japan the top U.S. creditor for the first time since the financial crisis.

The Treasury data should be taken with a grain of salt: Transactions carried out by other nations on behalf of China and Japan aren't included, making the final tally more of an educated guess.

Related: Bubble trouble? China's stock market looks too hot

But the Japan-China switch is backed by larger trends, and changes in the way Beijing manages its foreign reserves. Treasury data show that over the past year, China's U.S. debt holdings dropped by $49.2 billion, while Japan's increased by $13.6 billion.

China had been buying Treasuries as a way to keep its currency, the yuan, pegged to the U.S. dollar. That helped lower the value of the yuan and made China's exports more competitive in foreign markets.

But in recent years, partly due to U.S. pressure and partly as an effort to curb its own inflation, China has allowed the yuan to rise in value.

Closer to home, there's another major buyer of U.S. debt: the Federal Reserve. At last count the central bank owned around $2.5 trillion worth of Treasuries, up from around $800 billion at the end of 2007.