(Reuters) - U.S. stocks tallied their third straight session of gains on Wednesday, led by energy shares as oil prices jumped, while better-than-expected economic data helped allay growth fears.

Nine of the 10 major S&P sectors closed higher, with energy rising 2.9 percent.

The S&P 500 posted its first three-day rally of 2016, and ended with its biggest three-day percentage rise since August. With Wednesday’s performance, the Dow industrials had erased nearly all its losses for February.

Still, the benchmark S&P remains down 5.7 percent this year. The steep slide in oil, whose performance has been tightly tied to equities, along with fears of a China-led slowdown in global growth have rattled markets.

Oil prices rose 7 percent on Wednesday after Iran voiced support for a Russia-Saudi-led move to freeze production. Data also showed U.S. industrial production in January rose by the most in 14 months.

“Oil continues to directionally trade with equities and oil prices are higher, and more important, economic data recently has been better than feared,” said Jason Ware, chief investment officer at Albion Financial Group in Salt Lake City.

“Meanwhile, the backdrop for equities is oversold...This has certainly compelled some folks who are under-invested to get back into the stock market,” Ware said.

Traders work on the floor of the New York Stock Exchange (NYSE) February 11, 2016. REUTERS/Brendan McDermid

The Dow Jones industrial average rose 257.42 points, or 1.59 percent, to 16,453.83, the S&P 500 gained 31.24 points, or 1.65 percent, to 1,926.82 and the Nasdaq Composite added 98.11 points, or 2.21 percent, to 4,534.07.

The U.S. indexes built on their gains after minutes from the U.S. Federal Reserve’s January policy meeting were released in the afternoon.

The minutes showed Fed policymakers worried last month that tighter global financial conditions could hit the U.S. economy and considered changing their planned path of interest rate hikes in 2016.

“The sense of what has come out of that, is that you’re not going to see a rate hike in March and you may not even see one in June,” said Chuck Carlson, chief executive officer at Horizon Investment Services in Hammond, Indiana. “What it has done basically is taken that potentially negative issue off the table for the time being.”

Kinder Morgan shares rose 10 percent to $17.18 and led a rally in energy infrastructure-tied companies after Berkshire Hathaway disclosed a stake in the pipeline operator.

Priceline closed 11.2 percent higher at $1,235.56 after the travel websites operator’s profit beat expectations.

Fossil surged 28.6 percent to $44.30 after the watchmaker’s quarterly results beat estimates.

About 9.1 billion shares changed hands on U.S. exchanges, below the 9.5 billion daily average for the past 20 trading days, according to Thomson Reuters data.

Advancing issues outnumbered declining ones on the NYSE by 2,562 to 528, for a 4.85-to-1 ratio on the upside; on the Nasdaq, 2,057 issues rose and 768 fell for a 2.68-to-1 ratio favouring advancers.

The S&P 500 posted 14 new 52-week highs and 2 new lows; the Nasdaq recorded 20 new highs and 45 new lows.