China's massive stake in U.S. Treasuries gets a lot of attention. But it's Japan, and not China, that has been busy gobbling up U.S. debt over the past year.

In fact, Japan could soon pass China as the largest foreign holder of Treasuries. China held about $1.15 trillion in U.S. bonds through August, the most recent reading available from the Treasury Department. That's little changed from the start of the year and down from 12 months ago.

Meanwhile, Japan has been steadily adding to its Treasury holdings. It now owns $1.12 trillion, up 24% from a year ago.

But despite this trend, it's the Chinese ownership of U.S. debt that has become an issue in the presidential election.

Republican challenger Mitt Romney said in the first debate on Oct. 3 that the level of debt held by China is a problem, and that he would cut all non-critical spending to avoid borrowing more.

Related: Why debt is a national security issue

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 markets such as the United States.

But over the past two 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.

Kevin Giddis, head of fixed income for Raymond James Morgan Keegan, noted that China simply doesn't need to buy as much U.S. debt as it did in the past.

Still, President Obama took credit for the rise in the value of the yuan in last week's debate, saying "the currency's actually gone up 11% since I've been president because we have pushed them hard."

Related: Treasury flash crash could become reality

But while China's Treasury holdings are down over the past year, Japan had little choice but to buy that U.S. debt, said Nick Stamenkovic, fixed income strategist at RIA Capital Markets in Edinburgh.

He noted that worries about the European sovereign debt crisis have pushed Japan back to dollar denominated assets like U.S. bonds.

"Japan has clearly pulled back from Europe and looked at other places to place their money," he said. "Treasuries have been a beneficiary of that."