Investors have poured the most money on record into commodity ETFs in the first quarter, but that may be masking growing investor caution on raw materials.

Long-only exchange-traded funds linked to broad baskets of energy, metals and agricultural products attracted $2.66 billion during the quarter, Bloomberg Intelligence estimates show. While that’s the largest quarterly inflow in data going back to 2005, the stream of money slowed in March as the U.S.-China trade row clouded the outlook for economic growth. That uncertainty boosted haven demand for gold, which accounts for more than 12 percent of the Bloomberg Commodity Index -- a benchmark for many of these long ETFs.

“It’s primarily the precious-metals side” that is attracting money in commodities, said Mariann Montagne, a portfolio manager at Gradient Investments LLC, which oversees $2 billion including bullion-backed ETFs. “People are turning to gold as a hedge against inflation, but it’s also tied into all the tariff talk, which initially had been very broad-brushed in nature.”

Precious metals-backed ETFs attracted $1.79 billion this quarter through March 28, set for the biggest quarterly inflow since the three months ended June. Inflows were boosted by the $1.22 billion that were added in March, with gold making up $1.14 billion of that. Gold demand increased after U.S. President Donald Trump announced tariffs on imports of steel and aluminum imports, and duties on $50 billion of shipments from China. Industrial metals have lured about $240 million this quarter, the most since 2011.

Inflows were trimmed by over $9 million in outflows this month amid concerns that a trade war could slow global growth, damping demand. Outflows in energy-linked ETFs rose to $2.95 billion this quarter, the most since the quarter ended September.

Investors are cashing in after crude oil rallied to the highest in three years. Agriculture ETF inflows have reached $160 million this quarter, the highest since the third quarter, as gains in January and February outweighed an outflow this month. Total inflows into all commodity-linked ETFs have reached $1.9 billion, the highest since the second quarter of 2017.

This article was provided by Bloomberg News.