US Stocks Post Solid Gains, Led by Tech Shares

US stocks followed technology shares to push higher Friday after a week of uncertainty, shaking off record-high oil, a federal probe into the nation's largest mortgage lender and another batch of disappointing earnings reports.

For the week, the Dow Jones Industrials rose 2.11 percent, while the Standard and Poor's 500 index rose 2.31 percent. The Nasdaq fared even better on the week, rising 2.9 percent.

Major US stock indexes finished on higher ground following days of panic-buying and uncertainty, led by strongly positive earnings from Microsoft and unexpected optimism from Countrywide Financial, whose chief executive confirmed that he is the subject of a Securities and Exchange Commission investigation.

All of the major indexes gained ground from the start and held it, despite continued uncertainty over the housing market and the financial sector.

A major factor in the market gain was Microsoft, which posted a sharprise in quarterly profit after the bell on Thursday, boosted by healthy demand for personal computers loaded with its Windows operating system and strong sales of its "Halo 3" video game.

Analysts, meanwhile, considered the developments at Countrywide, the nation's largest mortgage lender, indicative of better days ahead.

"You're going to see more cuts in terms of jobs, but ultimately this subprime thing is going to strengthen them," said Randy Carver of Ohio-based Carver Financial Services. "It's going to clean up a lot of their business. Going forward they're going to be a lot more restrictive in their lending."

Microsoft was only one of several technology shares that had a buoyant day, with Internet company Yahoo rising 7.3 percent and the tech-heavy Nasdaq gaining 1.9 percent to have its best day in a month.

Countrywide , which is being investigated for possible connections to the subprime fallout and for stock sales by its chief executive, posted a $1.2 billion third-quarter loss Friday, hurt by write-downs as the housing market deteriorated.

But the lender also said the quarterly loss, its first in 25 years, represents an "earnings trough." It projected fourth-quarter profit of 25 cents to 75 cents per share, and expects to be profitable in 2008. It also said it has negotiated $18 billion of "highly reliable" new liquidity.

The development, which saw Countrywide shares soar, also gave assurance to investors who have been on constant watch for news of more subprime woes.

"People haven't quite figured out where the dead bodies are," said Jason Pride, director of research at Haverford, a Philadelphia-based investment management firm that holds Countrywide shares. "This is a period where we're going through all the closets and searching for the skeletons. Some companies are turning out that they don't have any skeletons."

Earlier this week Merrill Lynch stunned the market with revelations that its exposure to subprime fallout was far worse than feared, sending shares downward.

But that trend reversed itself Friday when CNBC reported that Merrill Chief Executive Stanley O'Neal would be ousted for contacting Wachoviaofficials for a possible merger without consulting Merrill's board.

Moving the Market

Other big movers on the day were DeVry , which saw shares jump as much as 37.6 percent amid analyst upgrades after the for-profit education company posted earnings that easily trumped expectations, while Ambac Financial Group slumped on concerns over the lender's exposure to subprime losses.

Shares of WellCare Health Plans also continued to fall sharply Friday, resuming a brutal slide after more than 200 federal and state agents stormed its Tampa, Fla. headquarters Wednesday.

Time Warner also gained on speculation that CEO Richard Parsons would announce his departure next week, a long-anticipated move that would allow President and Chief Operating Officer Jeffrey Bewkes to replace him.

Meanwhile, U.S. light, sweet crude oil climbed to a new record Friday before retreating, but stayed high amid concerns over supply and the growing tensions between the US and Iran. Nymex crude set a record closing high of $91.86 a barrel.

The gain in oil prices was being fueled by a rush on call options from traders looking for prices to hit $100 a barrel over the next several months. Commodities overall scored large gains, with gold vaulting to $780 an ounce to 28-year highs.

While there appeared to be no short-term damage to the market because of oil's rise, analysts worried that consumers would react if prices at gas pumps started going up.

"The higher oil prices are not helping the consumer and they're not helping the market in general," Pride said. "On a day-by-day basis, the correlations are not as tight. In the longer term, that's not helping."

Treasuries also gained on continued speculation that the Fed will trim rates next week, which generally tempered inflation fears across the market.

The day's only economic indicator, on consumer sentiment, came in below analyst expectations.

The Reuters/University of Michigan Surveys of Consumers said its late October figure on consumer sentiment was 80.9, down from the month's preliminary reading of 82 and the final September reading of 83.4. It was the lowest reading since May 2006 when the index stood at 79.1.

The survey found that concerns about the housing slump darkened the economic outlook.

Analysts said the volatility that has gripped the markets over the past week was not likely to end. The Volatility Index for most of the week has stayed above 20, considered the threshold for high volatility.

Earnings Continue

Other companies that reported earnings Friday included oilfield services provider Baker Hughes , consumer products company Fortune Brands , and waste and environmental services provider Waste Management .

Baker Hughes came in just under estimates, while Waste Management also missed and Fortune Brands beat expectations but lowered full-year guidance.

-- Reuters contributed to this report.