Stocks rose on Wednesday as the energy sector got a lift from higher oil prices, but sentiment was kept in check with a key part of the U.S. yield curve inverting even further, exacerbating fears of an impending recession.

The Dow Jones Industrial Average closed 258.20 points higher, or 1% at 26,036.10. The S&P 500 climbed 0.7% to 2,887.94 while the Nasdaq Composite advanced 0.4% to end the day at 7,856.88. Chevron and Exxon Mobil contributed to the Dow's gains, rising 0.8% and 0.7%, respectively.

The S&P 500 energy sector jumped 1.4%, led by a 10.6% surge in Cimarex Energy, as U.S. crude prices surged more than 1%. Oil jumped after the Energy Information Administration said U.S. crude inventories plummeted by 10 million barrels last week. Crude gained settled at $55.78 per barrel.

Consumer stocks such as Tiffany and Kohl's also rose 3% and 3.4%, respectively. Tiffany posted quarterly earnings that beat analyst expectations.

However, trading volumes remained subdued ahead of the U.S. Labor Day holiday on Monday. The SPDR S&P 500 ETF Trust (SPY) traded just over 55 million shares. That's well below its 30-day volume average of 81.8 million shares. Lower trading volumes can lead to bigger swings in markets.

Stocks started off the session trading lower as the bond market continued to flash a recession signal.

The closely watched spread between the 10-year Treasury yield and the 2-year rate briefly fell to negative 6 basis points Wednesday. The move extended losses from the previous session when the spread registered its lowest level since 2007.

A 10-year rate below the 2-year yield is viewed by fixed income traders as an important recession prognosticator, marking an unusual phenomenon as bondholders receive better compensation in the short term. Meanwhile, the U.S. 30-year Treasury yield fell to a new record low on Wednesday.