Stocks rose on Friday, capping their third straight monthly advance, as rising commodity prices lifted shares of natural resource companies, while a sliding dollar boosted the allure of multinationals, including Coca-Cola Co .

Investors were encouraged by a report showing in May consumer confidence hit its highest in eight months, while the run-up in commodities fueled bets that overseas demand would underpin a recovery in the global economy.

U.S. front-month crude oil futures rose $1.23 percent, or 1.8 percent, to $66.31 a barrel, supporting gains in such stocks as Chevron , Exxon Mobil and ConocoPhillips . The S&P energy index <.GSPE> rose 1.2 percent.

Shares of Coca-Cola, which gets the bulk of its sales from abroad, jumped almost 5 percent after the dollar slid to five-month lows against a basket of currencies.

The beverage maker was the Dow's top boost, followed by technology services company International Business Machines Corp , up 1.5 percent to $106.28.

It's clear to me, based on the market action, that we've turned a corner in this economy, said Sasha Kostadinov, portfolio manager and research analyst at Shaker Investments in Cleveland.

The question that I have is, when we get a clear view of what's around the corner, is it going to be better growth and moderate inflation, or is it going to be slow growth and bad inflation?

The Dow Jones industrial average <.DJI> gained 96.53 points, or 1.15 percent, to 8,500.33. The Standard & Poor's 500 Index <.SPX> climbed 12.31 points, or 1.36 percent, to 919.14. The Nasdaq Composite Index <.IXIC> rose 22.54 points, or 1.29 percent, to 1,774.33.

Since hitting a 12-year low in early March the S&P 500 has risen 35.9 percent. The third straight monthly advance is the index's longest monthly winning streak since fall 2007.

In May the S&P 500 rose 5.3 percent, the Dow gained 4.1 percent and the Nasdaq advanced 3.3 percent.

While rising oil prices are a boon for energy companies and a harbinger of improved worldwide demand, a jump in energy costs could present a significant headwind for consumers and businesses at a time when investors are looking for a spending recovery to fuel an economic revival.

In addition, a surge in commodity prices heightens the specter of inflationary pressures in the long run.

The slumping dollar lifted prices of other commodities, sending August gold futures as high as $982 an ounce, the highest since late February. Shares of miner Freeport-McMoran Copper and Gold Inc were up 4.3 percent to $54.43 and the gold BUGS index <.HUI> gained 3.3 percent.

Chevron shares finished up 1.3 percent at $66.67, while ConocoPhillips climbed 0.5 percent to $45.84, and Exxon Mobil gained 0.2 percent to $69.35.

Shares of Caterpillar Inc , a maker of bulldozers and excavators, whose customers include mining companies, jumped 2.5 percent to $35.46. On Nasdaq, shares of software maker Microsoft Corp were a top boost, rising 2.2 percent to $20.89.

Among declining stocks, General Motors Corp plunged 33.04 percent to 75 cents as the beleaguered automaker drew closer to filing for bankruptcy protection. While the bankruptcy has been expected, analysts say there are worries about the implications for jobs, business and consumer sentiment in the months ahead.

In the bond market, the benchmark 10-year Treasury note capped its worst two-month sell-off since 2003 despite recovering slightly on Friday.

(Editing by Kenneth Barry)