By Saqib Iqbal Ahmed

NEW YORK (Reuters) -Investors 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, real estate investment trusts, healthcare and utilities. 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%.

By contrast, the S&P 500’s energy and information technology sectors, 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.

Net inflows into the Consumer Staples Select Sector SPDR Fund stood at $697 million in December, putting it on track for its strongest month since July, according to Refinitiv Lipper data. The Health Care Select Sector SPDR Fund drew net inflows of $963 million this month after pulling $1.1 billion in November, which was its best month since July.

Some market participants, however, believe the rallies in defensive shares are likely a short-term phenomenon and expect an unwinding in early 2022 as investors return to the big technology and growth stocks that have led markets higher for years.

Zachary Hill, head of portfolio management at Horizon Investments, believes some of the strength in defensive stocks may reflect fund managers taking profits on winning positions and reallocating funds toward beaten-down names, a common year-end practice for many investors.

“It’s not terribly surprising after a really good year for stocks to see some of the laggard sectors… do a little bit better,” Hill said. “That’s something that could potentially reverse in January.”

That theory makes sense this year, with the S&P’s energy and information technology sectors up 48% and 33% for the year, respectively. Those gains dwarf the year-to-date performance of utilities, REITs, healthcare and consumer staples.

On a historical basis, utilities have been the top performing S&P sector in December, logging an average gain of 1.9% for the month since 1990, only to fall 0.25% on average in January, according to a CFRA Research analysis.

Information technology, meanwhile, has been the worst performer in December with an average gain of 0.67%, but has logged an average gain of 2.83% in January, the data showed.

Since 1990, the information technology sector has risen about 4,650%, while the utilities sector is up about 250%.

“People are much more willing to embrace risk in the new months than they are in the final months of the year,” said Sam Stovall, chief investment strategist at CFRA.

A threat to the recent rally in defensive stocks could also come from higher Treasury yields, which may accompany a more hawkish Fed and dim the allure of utilities and other sectors that draw investors with their comparatively high dividends, said Rob Haworth, senior investment strategist at U.S. Bank Wealth Management.

An early December Reuters survey of over 60 fixed-income experts showed the yield on the benchmark U.S. 10-year note rising to 2.08% in the next 12 months. On Friday, the yield on the 10-year note was at 1.50%. The Fed has signaled a faster tapering of its asset purchases and three rate hikes for 2022.

Others, however, say a more aggressive Fed could also weigh on the broader S&P 500, where valuations stand at their highest level in around two decades.

On Dec. 20, analysts at Morgan Stanley said they favored defensive stocks over cyclicals, as the Fed begins paring back monetary accommodation from markets.

“Growth stocks would be more vulnerable to that tapering than defensive ones given their much higher valuations,” the bank’s analysts wrote.

Hill, of Horizon Investments, believes stocks are likely to be more volatile next year after a relatively placid 2021. The S&P 500’s one-month volatility averaged 12.5 for the year, the lowest since 2017, according to Refinitiv data.

“It won’t be nearly as straight a line as we had this year but we still think the outlook for stocks is broadly positive,” he said.

(Reporting by Saqib Iqbal Ahmed; Editing by Ira Iosebashvili, Howard Goller and Rosalba O’Brien)