Foreign governments are dumping U.S. debt like never before.

In a bid to raise cash, foreign central banks and government institutions sold $57.2 billion of U.S. Treasury debt and other notes in January, according to figures released on Tuesday. That is up from $48 billion in December and the highest monthly tally on record going back to 1978.

It's part of a broader trend that gathered steam last year when central banks sold a record $225 billion of U.S. debt.

"Foreigners have no longer been our BFF when it comes to buying U.S. Treasuries," Peter Boockvar, chief market analyst at The Lindsey Group, wrote in a client note.

So what are foreign central bankers doing with these piles of cash? They're mostly using the funds to stimulate their own economies as the global growth slowdown and crash in oil prices continue to take their toll.

For instance, China has been liquidating its holdings of foreign debt to pump money into its slowing economy, plummeting currency and extremely volatile stock market. China, the largest owner of U.S. debt, trimmed its Treasury holdings by $8.2 billion in January, the Treasury Department said. The actual decline was likely larger considering China reported selling $100 billion of foreign-exchange reserves in January.

Related: China leads global U.S. debt dump

Oil crash fuels sales

Countries exposed to the oil price crash are using the cash to fill giant holes in their budget. Norway, Mexico, Canada and Colombia all cut their Treasury holdings in January as oil plunged below $30 a barrel for the first time in a dozen years.

Foreign sales of U.S. debt appear to be largely driven by economic necessity.

"These foreign sales are not fundamentally driven. The U.S. economy seems to be on better footing," said Sharon Stark, fixed income strategist at D.A. Davidson.

That's why total foreign holdings of U.S. debt actually rose in January to $6.18 trillion. That's because demand from global investors continues to be high. Besides, some foreign governments added to their piles of Treasury bonds, including Japan, Brazil and Belgium.

Related: Central banks' steroids aren't working

But there's still lots of demand for U.S. debt

Despite all these foreign government sales, demand for U.S. Treasuries remains high. In fact, the U.S. can borrow money at a lower rate now than at the beginning of the year.

The benchmark 10-year Treasury yield is sitting at 1.99%. That's down from nearly 3% two years ago. Demand is driven by the relative strength of the American economy, which continues to add jobs at a healthy pace despite the global headwinds.

The diminished appetite from overseas is being offset by a number of factors. First, the turmoil in global financial markets has boosted appetite for safe-haven assets like U.S. government debt.

U.S. Treasury low yields are better than nothing elsewhere

Second, foreign central bankers in Europe, Japan and elsewhere are experimenting with negative interest rates to stimulate their sluggish economies. This phenomenon has the side effect of pulling down rates for U.S. debt. Plus it makes U.S. debt more attractive as an investment.

Even though the Federal Reserve's bond-buying program has ended, the U.S. central bank continues to gobble up Treasuries. That's because the Fed is reinvesting the proceeds from its $4.2 trillion portfolio by purchasing U.S. debt.

All of these factors help explain why few think Treasury bonds' role as the bedrock of the global financial system is going away any time soon.

"Treasuries are the best kind of collateral out there. The U.S. still engenders the most confidence over the next 10 years relative to other economies," said Nicholas Colas, chief market strategist at ConvergEx.