S&P posts best month since July; energy stocks skyrocket 5% amid OPEC deal
OPEC agreed to cut production by approximately 1.2 million barrels per day, or about 4.5 percent of current production . U.S. crude futures for January delivery spiked 9.31 percent to settle at $49.21 per barrel.

That said, the three major U.S. indexes recorded sharp monthly gains, with the Nasdaq and S&P notching their best month since July, while the Dow had its best month since March.

The Nasdaq composite underperformed, sliding around 1 percent as the iShares Nasdaq Biotechnology ETF (IBB) fell more than 2 percent. Both the Nasdaq and S&P had traded higher earlier in the session.

"There are two things going on. You're seeing rates continue to push higher and that's starting to cause more of a headwind as we move closer to this rate decision," said Daniel Deming, managing director at KKM Financial. "Also, we've been seeing the Nasdaq weaken all day, creating further weakness in the overall market."

"It feels like the market is doing the end-of-the-month dance," said Art Hogan, chief market Strategist at Wunderlich Securities. "A bit of a giveback here on the last day of the month makes sense. Tomorrow, a new month starts and December has some pretty good cyclicals."

The Dow Jones industrial average briefly rose 100 points, hitting a new record intraday high of 19,225.29, before closing about 2 points higher as Goldman Sachs , Chevron and DuPont contributed the most gains. The S&P 500 closed about 0.25 percent lower, after also reaching record levels, with energy spiking about nearly 5 percent to lead advancers. The Energy Select Sector SPDR Fund (XLE) also popped nearly 5.1 percent. A 3.18 percent fall in utilities, however, offset energy's sharp gains.

Stocks closed mixed on Wednesday, the last day of the month, as energy stocks surging on an OPEC deal to cut production, while investors digested solid economic data.

"Oil is leading the way and we had some very good economic data," said Peter Cardillo, chief market economist at First Standard Financial. "The oil deal is good news and it should help stocks. The economic news is even better because it points to better growth."

"This is certainly the best present traders could have for Christmas," said Naeem Aslam, chief market analyst at Think Markets. "The cartel has shown a united front and this is what matters the most. There have been so many doubts over the year if they have the ability to deliver anything and today they have."

On the data front, private companies added 216,000 jobs in November, well above the expected 165,000, according to ADP and Moody's Analytics. ADP and Moody's report is often seen as a prelude to the U.S. government's monthly jobs report, due Friday. Meanwhile, consumer spending rose 0.3 percent in October, while personal income gained 0.6 percent, the best showing since April.



"Yesterday we also had a strong consumer confidence number. If you combine that with solid employment data ... you get higher markets," said Mike Baele, managing director at U.S. Bank Private Client Reserve. He also said that there "is some enthusiasm" in the market, given the recent economic data and rising corporate earnings.

The Chicago PMI index reading for November came in at 57.6, well above an October reading of 50.6. Pending home sales rose 0.1 percent month over month in October and 1.8 percent year over year, in line with expectations.

Other data released Wednesday included the Fed's Beige Book, which said the U.S.s is seeing moderate growth in most regions of the country.

Economic data has been at the forefront for investors as they brace themselves for a possible interest rate hike from the Federal Reserve next month. Market expectations for a December rate hike are above 90 percent, according to the CME Group's FedWatch tool.



"Janet Yellen will add restrictive measures in December and has an unambiguous intention to do so on two separated occasions in 2017. However, her pace toward normalization still trails that for expectations for inflation which will allow the yield curve to steepen further to encourage financial institutions to lend to both businesses and individuals," Jeremy Klein, chief market strategist at FBN Securities, said in a note.

U.S. Treasury prices fell broadly on Wednesday, with the two-year note yield rising to 1.11 percent and the benchmark 10-year yield trading higher at 2.38 percent.

The U.S. dollar rose 0.54 percent against a basket of currencies, with the euro trading around $1.059 and the near 114.37.

"The Euro continues to be battered by the painful combination of Eurozone growth concerns and fears of political instability in Italy. Tuesday's positive stance from the ECB pledging to buy more Italian bonds post Italian referendum did little to quell the downside pressures on the EURUSD with bears exploiting this opportunity to send prices lower," Lukman Otunuga, research analyst at FXTM, said in a note to clients.



Italy is scheduled to hold a referendum on Sunday in which citizens will vote in a referendum on whether to overhaul their national constitution. However, the vote has also become a referendum on Prime Minister Matteo Renzi himself, as he has pledged to resign if the "No" vote wins.

European equities traded mostly higher on Wednesday, with the pan-European Stoxx 600 index rising 0.31 percent. In Asia, stocks closed mixed, with the Korean Kospi rising 0.26 percent and the Japanese Nikkei 225 closing flat.