Even this oil spike can’t lift the worst-performing sector of the last decade

Investors are pondering if the escalated U.S.-Iran tensions that are spiking oil prices could serve as the catalyst needed to turn around the most hated sector for the past 10 years.

The S&P 500 energy sector was the worst performer of the last decade, up just a measly 5% versus the S&P 500’s 180% climb as a 10-year equity bull market boomed.

Investors have exited oil names so unreservedly over the years that energy now holds a weight of only 4% in the S&P 500, compared with more than 13% in 1990, according to Bespoke Investment Group.

Oil prices surged 3% on Friday following the killing of Iran’s top commander in a U.S. airstrike in Baghdad, raising concerns of a bigger conflict between the two countries that could disrupt energy production and send crude prices even higher. WTI oil spiked more than 4% at one point Friday.

Shares of some oil producers and explorers including Diamondback Energy, Occidental Petroleum and Devon Energy rallied in response, becoming some of the best performers in the S&P 500 on Friday.

Though overall, the sector was still weak even on the oil spike with shares of Exxon Mobil and Chevron dragging the broad energy index lower. The Energy Select SPDR lost nearly 0.4% on Friday.

“There will be a geopolitical premium that goes into the oil price and that puts a bid under a lot of oil companies,” Alec Young, managing director of global markets research at FTSE Russell, said Friday on CNBC’s “Squawk Box.” “Great dividend yields there. Everyone is looking for income, so people are going to maybe take a slightly more positive, constructive view on energy, which is good.”

Deutsche Bank oil analyst Chris Snyder said U.S. oil producers would be the best way to take advantage of the Middle East flare-ups as they have shown an ability to quickly ramp up production in response to commodity price moves. Snyder named Halliburton as the preferred stock in the sector. Its shares were up 0.3% Friday.

However, some believe it’s still premature to jump into the struggling group as the post-attack rally could be short-lived.

“I certainly would not be a buyer of this group,” CNBC’s Jim Cramer said of energy stocks Friday on “Squawk on the Street.” “Don’t buy them today because you may have to sell them tomorrow”

The energy sector was the biggest loser again in 2019 amid volatile commodity prices, returning only about 7% compared with the S&P 500’s nearly 29% gain.

With shale production contributing to an oversupply, oil prices have failed to climb back to their pre-crisis level of $100 a barrel. While some smaller oil producers may have benefited from the revolution, big names like Exxon Mobil have been struggling. Shares of Exxon Mobil are down more than 30% from their 2014 peak of $104.

However, Wall Street analysts seem to have warmed up to the group going into 2020 after years of underperformance. In fact, the energy sector now has by far the highest percentage of buy ratings in the S&P 500, according to Bespoke.

Goldman Sachs predicted “a bottoming phase for Energy equities in 2020,” adding that EOG Resources, Pioneer Natural Resources and Parsley Energy are compelling buys within the exploration and production industry.

— CNBC’s Michael Bloom contributed reporting

"Everyone is looking for income, so people are going to maybe take a slightly more positive, constructive view on energy," one analyst said.