NEW YORK (TheStreet) -- The S&P 500 celebrated a new record close on Thursday, climbing slightly after higher crude prices fueled a rally in the energy sector.

The S&P 500 was up 0.23% to 2,130.8, above its May 18 record of 2,129. The Dow Jones Industrial Average was flat, and the Nasdaq added 0.38%.

Crude oil notched its best gains in a month as commodity traders bet the latest weak data out from China would encourage the People's Bank of China to introduce further monetary stimulus. The HSBC China Manufacturing Purchasing Managers Index increased to 49.1 in May, up from 48.9 in April though it remained under 50 which signals contraction.

Also boosting commodity markets, the Energy Information Administration reported Wednesday a fall of 2.7 million barrels in crude supplies for the week ended May 15. Analysts had expected a drop of 2 million barrels. West Texas Intermediate added closed 3% higher to $60.72 a barrel.

BP (BP) was 2% higher after settling with Halliburton (HAL) and Transocean (RIG) over claims related to the 2010 Gulf of Mexico oil spill. Transocean will get $125 million compensation for legal claims, though will have to pay nearly double that into a fund compensating victims of the spill. Transocean gained 4.3% while Halliburton climbed 2.7%.

Other winners in the energy sector included Chevron (CVX), Schlumberger (SLB), and Petrobras (PBR). The Energy Select Sector SPDR ETF (XLE) added 0.93%.

A series of weak data out in the morning session underscored the case for a Federal Reserve rate hike later this year. U.S. manufacturing activity slowed in May, according to Markit's manufacturing purchasing index. The headline reading of 53.8 was down from 54.1 in April, while new orders growth slowed to its slowest pace since January 2014.

"The May flash PMI is consistent with our expectation that the domestic manufacturing sector will continue to face headwinds from the lagged effects of stronger dollar and lower energy prices," said Barclays analyst Jesse Hurwitz in a note.

Existing U.S. home sales fell 3.3% in April to an adjusted annual rate of 5.04 million, falling back from March highs as prices rose, according to the National Association of Realtors. Economists had expected an April rate of 5.24 million.

The Philadelphia Fed Business Outlook fell to a reading of 6.7 in May from 7.5 a month earlier. Economists had expected the measure to tick up to 8.

Fed minutes from the central bank's April meeting were released on Wednesday and showed that many on the Fed board saw a June rate hike as unlikely, with only a few members supporting an increase next month.

Initial jobless claims for the week ended May 15 climbed 10,000 to a four-week high of 274,000. Economists had expected claims to climb to 269,000. The measure, however, remained near 15-year lows.

McDonald's (MCD) shares pressured the Dow as protesters demonstrated outside of the corporate offices in Illinois at the company's annual shareholder meeting on Thursday. The protesters are calling for the fast food chain to raise wages to $15 an hour.

Amazon (AMZN) climbed nearly 2% on news it will begin to offer one-hour delivery from local stores in Manhattan to Amazon Prime Now customers. The online retailer also received a price target boost from Morgan Stanley. Click here for more.

In earnings news, Best Buy (BBY) surged more than 3% after earning 37 cents a share in its recent quarter, above forecasts of 29 cents. Revenue of $8.56 exceeded estimates of $8.46 billion. Salesforce.com (CRM) also moved higher after posting quarterly net income of 16 cents a share, well above estimates of 2 cents. Revenue climbed 23% to $1.51 billion, only slightly higher than forecasts.

Lumber Liquidators (LL) plummeted 16.5% after CEO Robert Lynch resigned. Founder Thomas Sullivan will assume the CEO position. The company has been in strife for months since a 60 Minutes report accused the company of unsafe flooring products.

Airline stocks were moving higher, recovering from two days of losses. The sector was shaky after Southwest Airlines (LUV) said it would increase capacity, fueling concerns carrier growth could outpace travel demand. Click here to read more.

Southwest is one of the top 10 companies in the S&P 500 expected to have the biggest earnings growth this year, according to S&P Capital IQ. Click here to read more.

More from Markets

Online Retailers Hit by Supreme Court Ruling Requiring Sales Tax Collection

Online Retailers Hit by Supreme Court Ruling Requiring Sales Tax Collection

U.S. Drillers at Mercy of Iran, Saudi Production Spat as OPEC Meeting Begins

U.S. Drillers at Mercy of Iran, Saudi Production Spat as OPEC Meeting Begins

Stocks Tumble as Dow Heads for Eighth Straight Drop

Stocks Tumble as Dow Heads for Eighth Straight Drop

This Is What's Hot Thursday - Stocks Slide, Intel's CEO Woes & Major Movers

This Is What's Hot Thursday - Stocks Slide, Intel's CEO Woes & Major Movers

Video: Jim Cramer on Netflix, Disney, Intel, Micron and Goldman Sachs

Video: Jim Cramer on Netflix, Disney, Intel, Micron and Goldman Sachs