"Stock Exchange" is seen over an entrance to the New York Stock Exchange (NYSE) on Wall St. in New York City, U.S., March 29, 2021. REUTERS/Brendan McDermidInvestors have piled into traditionally defensive stocks in the last weeks of the year, spurring a rally some believe may lose steam early in 2022.

The S&P 500’s top performing sectors this month are consumer staples (.SPLRCS), real estate investment trusts (.SPLRCR), healthcare (.SPXHC) and utilities (.SPLRCU). Each of the sectors, which are viewed as popular destinations during times of uncertainty, have risen by 9% or more in December and outpaced the broader index’s gain of about 5%. (.SPX)

By contrast, the S&P 500’s energy (.SPNY) and information technology sectors (.SPLRCT), among the year’s best performers, are up 2.9% and 3.3% for December. The broader index is up 27% in 2021 and on track for its third straight year of double-digit gains.

Investors have had plenty of reasons to turn defensive in recent weeks, as uncertainty over the new Omicron variant, soaring inflation and a hawkish shift at the Federal Reserve bolstered the case for caution.