Blue-chip stocks and the S&P 500 rose Friday amid a rally in crude oil and solid profit reports from oil-field services companies Schlumberger and Halliburton, but gains in tech shares were limited by disappointing quarterly outlooks from Microsoft and Google.

The Dow Jones industrial average (search) rose 23.41 points, or 0.22 percent, to end at 10,651.18. The Standard & Poor's 500 Index (search) added 6.64 points, or 0.54 percent, to finish at 1,233.68. The Nasdaq advanced 1.14 points, or 0.05 percent, to close at 2,179.74.

For the week, the Dow edged up 0.1 percent, the S&P 500 gained 0.5 percent, and the Nasdaq rose 1 percent.

Shares of Exxon Mobil Corp. (XOM), the world's biggest publicly traded oil company, jumped 2.8 percent, or $1.61, to $59.50, getting a lift from higher crude oil prices. Chevron Corp.'s (CVX) stock rose 1.4 percent, or 82 cents, to $57.79.

"We've had a sustained move in oil that doesn't seem to be giving back at all. From a fundamental view, we want to remain overweight on the energy sector," said Bryan Piskorowski, market analyst at Wachovia Securities LLC in Richmond, Virginia. "The major integrated companies like Exxon have been socking away a lot of cash."

U.S. crude futures for September delivery shot up $1.52 to settle at $58.65 a barrel on the New York Mercantile Exchange (search), buoyed by short covering as traders tracked a potential storm that could disrupt supply.

The two biggest U.S. oil field services companies — No. 1 Schlumberger (SLB) and No. 2 Halliburton Co. (HAL) — reported better-than-expected earnings. Schlumberger shares rose 5.5 percent, or $4.32, to $82.28 and Halliburton shares climbed 9.4 percent, or $4.59, to $53.29.

Investors' disappointment in the revenue forecasts from Microsoft and Google gave some a reason to sell tech shares, a day after both companies reported better-than-expected earnings.

Yet investors' optimism, buoyed by generally strong earnings throughout the week, asserted itself in late trading and produced modest gains for the major indexes. Maintaining that optimism, however, with stocks near four-year highs, will be difficult in the days ahead.

"The markets are just treading water here," said Michael Sheldon, chief market strategist at Spencer Clarke LLC. "Despite a generally positive week of earnings, the markets are in for a bit of consolidation or profit-taking over the next few days."

Dow component Microsoft (MSFT) posted a 37 percent gain in net earnings, but a large part of that came in a tax benefit, and analysts worried that the company's operating earnings weren't seeing stronger growth. Microsoft lost 68 cents to $25.76.

Google Inc. (GOOG) tumbled $12.73 to $301.21 despite beating Wall Street's second-quarter profit forecasts by a wide margin. The Internet search company more than quadrupled its net income and nearly doubled its revenues from a year ago, a stellar quarter by any measure. The stock had been bid up to a record high Thursday in anticipation of an even better performance, however, illustrating investors' soaring expectations for the company.

Better-than-expected earnings from Broadcom Corp. (BRCM), a maker of chips used in television set-top boxes and high-speed Internet modems, helped contribute to the S&P 500's gain. Broadcom's advance also buoyed the Philadelphia Stock Exchange semiconductor index, which rose 1.3 percent. Broadcom rose 11.4 percent, or $4.39, to $43 on the Nasdaq.

Kimberly-Clark Corp. (KMB) rose $1.44 to $64.29 as the maker of Kleenex tissues and Huggies diapers said it would cut 6,000 jobs and sell or close up to 20 manufacturing plants as part of a restructuring plan. The company's second-quarter earnings beat Wall Street expectations by a penny per share.

The Wall Street Journal reported that Ford Motor Co. (F) could lay off up to 15,000 white-collar workers in North America over the next few years, far more than had been expected. The news sent Ford shares up 8 cents to $10.72.

Struggling appliance maker Maytag Corp. (MYG) added 41 cents to $16.06 after posting a profit of 7 cents per share in the second quarter, versus a loss last year, but short of the 10 cents per share analysts had expected. The company said it is still considering whether a takeover bid by rival Whirlpool Corp. is better than one already received by a private equity group. Whirlpool dropped 57 cents to $77.33.

Bonds retraced much of Thursday's steep losses, with the yield on the 10-year Treasury note falling to 4.22 percent from 4.29 percent late Thursday. The dollar edged higher against most major currencies, recovering from a sharp drop Thursday after China's decision to revalue its currency. Gold prices also rose.

Trading was moderate on the NYSE, with about 1.37 billion shares changing hands, below last year's daily average of 1.46 billion, while on Nasdaq, about 1.71 billion shares traded, below last year's daily average of 1.81 billion.

Advancing stocks outnumbered declining ones by a ratio of more than 2 to 1 on the NYSE, and by nearly 2 to 1 on the Nasdaq.

The Russell 2000 index, which tracks smaller company stocks, closed the week 14.04, or 2.12 percent, higher at 677.78.

The Dow Jones Wilshire 5000 Composite Index — a free-float weighted index that measures 5,000 U.S. based companies — ended the week at 12,337.25, up 82.55 points from last week. A year ago the index was 10,553.82.

Reuters and the Associated Press contributed to this report.