NEW YORK (Reuters) - Wall Street’s main stock indexes rose to fresh all-time closing highs on Friday as a spike in oil prices supported energy shares and investors renewed their optimism about President Donald Trump’s economic agenda.

The S&P 500 tallied its fourth straight session of gains, a day after Trump vowed a major tax announcement in the next few weeks.

The benchmark S&P 500 has surged 8.3 percent since Trump’s Nov. 8 election, fueled by expectations he will lower corporate taxes, reduce regulations and increase infrastructure spending. The rally had stalled amid concerns over Trump’s protectionist stance and lack of clarity on policy reforms.

“Investors were worried that the administration may have gotten off track and was pursuing other items,” said Kim Forrest, senior equity research analyst at Fort Pitt Capital Group in Pittsburgh.

“Tax cuts have gotten put back on the front burner,” Forrest said, adding, “We are looking for gains in the economy at large from this, not just (earnings per share) gains in stocks.”

The Dow Jones Industrial Average .DJI rose 96.97 points, or 0.48 percent, to end at 20,269.37, the S&P 500 .SPX gained 8.23 points, or 0.36 percent, to 2,316.10 and the Nasdaq Composite .IXIC added 18.95 points, or 0.33 percent, to 5,734.13.

The S&P and Dow closed at a record high for a second straight session, while the Nasdaq extended its streak of record closes to a fourth day.

Energy shares .SPNY gained 0.8 percent. Oil prices rose more than 1 percent after reports that OPEC members delivered more than 90 percent of the output cuts they pledged in a deal that took effect in January.

Energy could continue to be in focus next week, when a host of small-cap companies in energy are due to report results.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., February 7, 2017. REUTERS/Brendan McDermid

The S&P financial sector .SPSY ended up 0.2 percent. The group initially moved higher after Daniel Tarullo, the top Federal Reserve official charged with financial regulation, said he would resign, creating further room for Trump to reshape the Fed's policymaking staff.

The focus on Washington comes as large U.S. companies were set for their second straight quarter of profit increases after several periods of declines.

With more than 70 percent of the S&P 500 having reported results, fourth-quarter earnings are on track to have climbed 8.4 percent, which would be the best performance since the third quarter of 2014, according to Thomson Reuters I/B/E/S.

“We are seeing a pretty solid rate of beats and we’re out of the earnings recession,” said Jason Ware, chief investment officer at Albion Financial Group in Salt Lake City.

Activision Blizzard ATVI.O surged 18.9 percent after the videogame publisher reported higher-than-expected revenue and set a $1 billion share buyback program. Its shares gave the biggest boost to the S&P 500 and the Nasdaq.

Skechers USA SKX.N jumped 19.3 percent after the footwear maker's fourth-quarter revenue beat expectations.

Sears Holding SHLD.O soared 25.6 percent after the struggling retailer said it would cut costs by $1 billion and reduce debt and pension obligations by at least $1.5 billion this year.

Advancing issues outnumbered declining ones on the NYSE by a 2.60-to-1 ratio; on Nasdaq, a 2.05-to-1 ratio favored advancers.

The S&P 500 posted 48 new 52-week highs and no new lows; the Nasdaq Composite recorded 151 new highs and 22 new lows.

About 6.6 billion shares changed hands on U.S. exchanges, compared with the 6.7 billion daily average for the past 20 trading days, according to Thomson Reuters data.