U.S. stocks rose for a fourth day Wednesday, sending major indexes to their highest since May, as battered energy shares such as Exxon Mobil Corp. (XOM) rebounded and investors bet interest rates won't rise any time soon.

The Dow Jones industrial average gained 45.23 points, or 0.39 percent, to end at 11,543.32. The Standard & Poor's 500 Index added 4.96 points, or 0.38 percent, to finish at 1,318.07. The Nasdaq Composite Index rose 11.85 points, or 0.53 percent, to end at 2,227.67.

Click here to visit FOXBusiness.com's Investing Center.

U.S. crude oil futures gained after seven straight sessions of declines, feeding a broader advance in the energy sector.

But with crude oil prices still down more than 18 percent since July, traders said investors were optimistic that the economy will avert a sharp downturn in consumer spending, helping sustain corporate profit growth.

Investors snapped up retail shares such as Home Depot Inc. (HD) and industrial stocks such as Boeing Co. (BA) and Caterpillar Inc. (CAT) on hopes that the pullback in oil prices will dissuade the Federal Reserve from resuming its campaign of interest-rate increases. Last month, the Fed paused after two years of raising rates.

"The market is having a little more confidence in the consumer, looking at this last run-up," said Mike Binger, portfolio manager at Thrivent Financial in Minneapolis.

"People are feeling more comfortable that inflation won't run away. If energy comes down, the consumer has a little more breathing room."

Wednesday's gain put the Dow 0.85 percent below its high for the year, which was hit in May, when the blue-chip average came within 80 points of its Jan. 14, 2000, record high of 11,750.28.

The American Stock Exchange index of oil shares scored its biggest gain in more than a month, rising for the first time in five sessions. The index ended up 1.4 percent.

Exxon Mobil led the S&P 500 higher and also helped boost the Dow. The stock of the world's largest publicly traded oil company finished up 1 percent, or 66 cents, at $65.36 on the New York Stock Exchange.

U.S. crude oil for October delivery rose 21 cents to settle at $63.97 a barrel on the New York Mercantile Exchange. The government reported a larger-than-expected draw in crude stockpiles in the latest week.

The Dow's biggest lift came from aircraft manufacturer and U.S. defense contractor Boeing, whose stock ended up 2.8 percent, or $2.06, at $76.32 on the NYSE. The stock of heavy equipment maker Caterpillar ranked as the Dow's second-biggest gainer, up 1.8 percent, or $1.18, at $66.33 on the NYSE.

Shares of Home Depot, the leading U.S. home improvement chain, gained 1.4 percent, or 51 cents, to $37.17 on the NYSE. Home Depot was among the Dow's biggest gainers.

Financial stocks also ranked among the session's biggest advancers, with shares of Lehman Brothers Holdings Inc. (LEH) up 3 percent, or $2.04, at $70.06 on the NYSE after the investment bank's quarterly profit beat Wall Street's forecast. The S&P financial index rose 0.7 percent.

Shares of Web search company Google Inc. (GOOG) contributed the most to the Nasdaq 100's gain, followed by shares of coffee chain operator Starbucks Corp. (SBUX), which is among the stocks seen as a gauge of consumer spending.

Google shares shot up 3.7 percent, or $14.67, to $406.57, while Starbucks gained 1.9 percent, or 60 cents, to $33.04.

But shares of computer maker Hewlett-Packard Co. (HPQ) fell 1.5 percent, or 55 cents, to $36.37 on the NYSE after the California attorney general said he has enough evidence to indict people at the company in an investigation into whether the computer maker illegally obtained private phone records.

Shares of drugmaker Merck & Co. Inc. (MRK) fell 2.6 percent, or $1.09, to $41.09 on the NYSE after two studies added kidney problems to the list of concerns already raised with the drug once sold as Vioxx.

Merck and Hewlett-Packard helped curb the Dow's advance.

Volume on the NYSE was active, with about 1.66 billion shares changing hands, slightly above last year's daily average of 1.61 billion. On the Nasdaq, about 1.93 billion shares traded, exceeding last year's daily average of 1.80 billion.

Advancers outnumbered decliners by a ratio of about 11 to 5 on the NYSE and by about 9 to 5 on the Nasdaq.

Click here to visit FOXBusiness.com's Investing Center.