Updated

Stocks rallied Friday, snapping three days of losses, as investors got a boost from encouraging results from software leader Microsoft (MSFT) and telecom gear maker Ericsson (ERICY) and a broker's bullish call on fast-food company McDonald's (MCD).

The blue-chip Dow Jones industrial average (search) advanced 137.33 points, or 1.52 percent, at 9,188.15. The broad Standard & Poor's 500 (search) gained 11.59 points, or 1.18 percent, at 993.32. The tech-laced Nasdaq Composite (search) was up 10.49 points, or 0.62 percent, at 1,708.51 -- a day after falling 2.8 percent, its biggest percentage loss in more thanales forecast for its fiscal year.

The Dow edged up 0.8 percent for the week. Despite the late-day rally, the S&P 500 lost 0.5 percent and the Nasdaq fell 1.5 percent for the week.

"Microsoft gave us a good push early and McDonald's helped," said Tim Smalls, managing director at S.G. Cowen.

The market got a boost in the afternoon from short sellers who covered positions before the weekend by buying shares and taking profits, traders said.

"With the market selling off yesterday, a lot of people may just be covering shorts and trying to even up for the weekend," said James Volk, managing director of equity trading at D.A. Davidson and Co. "It's really more of a technical bounce after yesterday's selloff than it is anything else."

Strong results from Ericsson, the Swedish telecoms equipment maker, boosted tech shares a day after they were hurt by disappointing earnings from Nokia , said Tim Smalls, managing director at S.G. Cowen.

"The Ericsson announcement kind of negated that and gave all the tech and telecom stocks a boost early and that helped push us forward," he said.

McDonald's climbed 90 cents, or 4.4 percent, to $21.39 and led the Dow higher. Bear Stearns upgraded the world's largest fast-food chain to "outperform" from "peer perform."

Microsoft, among Nasdaq's most actives, edged up 20 cents to $26.89. The stock, also among the 30 in the Dow average, earlier jumped as much as 2 percent. The world's largest software maker reported a 26 percent rise in net profit and boosted its revenue forecast for its fiscal year, despite a cautious outlook for modest growth in personal computer sales and weak technology spending.

Ericsson surged $1.71, or 15.9 percent, to $12.50 on Nasdaq. The company reported much better-than-expected quarterly results and pledged a return to profit this year despite a falling market.

AOL Time Warner Inc. (AOL) added 34 cents, or 2.1 percent, to $16.74. The media conglomerate said it had agreed to sell its CD and DVD making business to Canadian manufacturer Cinram International Inc. for $1.05 billion and use the proceeds to cut its $26 billion debt load.

Continental Airlines (CAL) rose 31 cents to $14.42 after Bear Stearns upgraded it to "outperform" from "peer perform." The move came a day after the company posted a smaller-than-expected second-quarter loss.

The University of Michigan's preliminary consumer sentiment index, a widely followed measure of consumers' mood, rose to 90.3 in July from a final reading of 89.7 in June.

The survey's index that tracks consumers' views of their present financial situation jumped to 102.8 in July from 94.7 in June. But the expectations index -- which measures attitudes about the 12 months ahead -- slipped to 82.7 in July from 86.4 in June.

The Economic Cycle Research Institute, a private forecasting group, said its weekly leading index rose to 126.8 in the week ended July 11, from a revised 124.9 the prior week.

Volume was active with 1.4 billion shares traded on the New York Stock Exchange and 1.6 billion shares changing hands on the Nasdaq. Advancers outweighed decliners by 2 to 1 on the NYSE and by 18 to 13 on the Nasdaq.

The Russell 2000 index, the barometer of smaller company stocks, rose 4.83, or 1.1 percent, to 464.76.

Overseas, Japan's Nikkei stock average finished Friday up 0.3 percent. In Europe, France's CAC-40 ended Friday essentially flat, slipping 0.01 percent. Britain's FTSE 100 advanced 0.4 percent and Germany's DAX index gained 1.1 percent.

Reuters and the Associated Press contributed to this report.