Wall Street rallied for the third consecutive session on Wednesday, propelled by sharp gains in energy stocks as a rebound in oil prices boosted sentiment heading into the Christmas holiday.
The S&P 500 finished 1.24 percent higher, bringing its gain this week to almost 3 percent following a soft start to December.
For 2015, the S&P 500 has emerged into marginally positive territory, up 0.26 percent while the Dow Jones industrial average is down 1.24 percent.
"There is a bit of a Santa Claus rally here. People want to feel good, they want to dress up their portfolios and look fully invested going into yearend," said Tim Ghriskey, chief investment officer of Solaris Group in Bedford Hills, New York.
Crude prices climbed after U.S. inventories fell but still hovered near multi-year lows as oversupply concerns persisted.
The S&P energy sector surged 4.24 percent, its heftiest one-day increase since August, trimming its deep loss in 2015 to 21 percent.
Chevron gained 3.92 percent and Exxon shares rose 3.27 percent, providing the biggest boost to the S&P 500.
"The perception is that crude prices may have bottomed, at least for the time being," Ghriskey said.
Freeport-McMoRan jumped 16 percent following gains in copper prices. That contributed to a 2.36 percent gain in the materials index, which was also helped by a report that China is set to cut its steel surplus that has kept prices at decade lows.
The Dow Jones industrial average ended up 1.06 percent at 17,602.61 points.
The S&P 500 gained 25.32 points to 2,064.29 and the Nasdaq Composite added 0.9 percent to 5,045.93.
U.S. stock markets will have a shortened session on Thursday and stay closed on Friday for Christmas. Trading volumes are expected to remain thin through the holiday period.
Data indicated the outlook for the economy remained encouraging, with consumer sentiment at a five-month high in December and personal income rising for the eighth straight month in November.
However, non-defense capital goods orders excluding aircraft, a closely watched proxy for business spending plans, fell last month as a stronger dollar and spending cuts dragged.
Celgene rallied 9.83 percent after the drugmaker said it settled a patent litigation over its top-selling cancer drug, Revlimid. The stock gave the biggest boost to the S&P and Nasdaq.
Nike reversed early gains and lost 2.38 percent. The stock hit a record high earlier in the day after the world's largest sportswear maker reported strong results.
Micron shares dropped 2.22 percent after the memory chip maker forecast a surprise loss for the second quarter.
Bed Bath & Beyond fell 4.58 percent after the home furnishings retailer cut its third-quarter profit forecast.
Advancing issues outnumbered decliners on the NYSE by 2,681 to 434. On the Nasdaq, 2,061 issues rose and 807 fell.
The S&P 500 index showed 13 new 52-week highs and two new lows, while the Nasdaq recorded 46 new highs and 52 new lows.
Volume on U.S. exchanges was 6.4 billion shares, compared to a 7.6 billion average over the last 20 trading days, according to Thomson Reuters data.
(By Noel Randewich; Additional reporting by Abhiram Nandakumar and Ankur Banerjee in Bengaluru; Editing by Meredith Mazzilli)