Reuters

Investors have poured a record $155 billion into bond funds over the last three months.

Since much of this activity has been in the form of sovereign debt purchases, it shows investors are seeking safe-haven assets as global uncertainty mounts.

A continuation of this trend could be a sign of looming recession, according to a strategist at Allianz Investment Management.

Read more on Markets Insider.

Investors are piling into bonds as continued global uncertainty sparks a desire for safety.

They've poured a record $155 billion into bonds over the past three months, according to data compiled by Bank of America Merrill Lynch.

A big part of this trend has been driven by inflows to government bonds, which are considered among the market's safest assets. They attracted $7.1 billion last week alone — the fourth-biggest ever inflow — amid an uptick in investor risk aversion.

That anxiety has been stoked by rising trade tensions and fears the global economy is deteriorating. When market conditions are volatile, investors tend to flee to high-quality assets that perform better during downturns.

Markets Insider is looking for a panel of millennial investors. If you're active in the markets, CLICK HERE to sign up.

"What we're seeing from a risk standpoint at this point in the market is really investors that are seeking haven in longer duration US treasuries," Charlie Ripley, a senior investment strategist for Allianz Investment Management, told Markets Insider in an interview.

A major driving force behind this behavior has been renewed fear of an impending economic recession. The spread between two- and 10-year Treasurys — the most closely watched section of the so-called yield curve — turned negative for the first time since 2007 last week. That's significant because such an inversion has occurred before every recession since 1950.

The yield curve inverted again this week after regional Federal Reserve heads offered hawkish commentary on the future path of interest rates. Meanwhile, China ramped up its trade war with the US on Friday. Given that past escalations have spurred concerns of an economic slowdown, that only adds to investor trepidation.

"If we continue to see a flight to quality in the longer end of the curve at some point we would expect that we're nearing a recession," Ripley said.

NOW WATCH: 7 lesser-known benefits of Amazon Prime