Strong earnings from big U.S. companies gave stocks a powerful boost Friday, but the markets remained on track for their worst week this year.
Hewlett-Packard had the biggest gain in the Dow Jones industrial average and the Standard & Poor's 500 index. It posted fiscal first-quarter earnings late Thursday that beat all forecasts, a relief after months of bad news for the computer maker. H-P rose $2.33, or 14 percent, to $19.43.
Cabot Oil & Gas Corp. was the S&P 500's second-best performer, jumping a day after reporting earnings that beat analysts' expectations. It rose $5.08, or 9 percent, to $58.94.
American International Group Inc. rose after its fourth-quarter operating results exceeded forecasts. The company's net loss was $4 billion, mainly because of claims related to Superstorm Sandy, in the first full quarter after it finished repaying its $182 billion government bailout. Its stock rose 79 cents, or 2 percent, to $38.07.
The Dow was up 105 points at 13,985 as of 1:50 p.m. Eastern time. The S&P 500 rose 10 to 1,512. The Nasdaq composite index rose 24 to 3,155.
The S&P 500 and Nasdaq are down for the week, while the Dow is roughly flat. The S&P 500 is on track for its first weekly loss of the year.
Bill Stone, chief investment strategist with PNC Wealth Management, said he expects stocks to hold up despite this week's volatility.
"You're going to get bumps and bruises along the way, but we do believe things are actually getting better, so I think there's underlying demand" for stocks, Stone said.
Spooked investors Wednesday sent stocks plunging after minutes from the Federal Reserve's latest policy meeting revealed disagreement at the Fed over how long to keep buying bonds in an effort to boost the economy. The slide continued Thursday. The Dow lost 155 points over those two days.
Many analysts say the Fed's bond-buying and resulting low interest rates have driven this year's stock rally, which lifted indexes to their highest levels since before the 2008 financial crisis.
U.S. stocks followed European stocks higher after a survey of German business optimism rose sharply, adding to evidence that the country will avoid a recession. Germany's economic vitality is crucial for the beleaguered region, offsetting economic contraction in surrounding countries.
"Germany is really the bedrock" of the region's economy, Stone said. "If it gives way, then you have real problems."
France's CAC-40 closed up 2.2 percent, Germany's DAX 1 percent.
Among the other corporate news moving markets:
— Abercrombie & Fitch sank after a key sales metric declined in the all-important holiday quarter. Its stock fell $3.46, or 7 percent, to $45.59.
— WebMD Health Corp. soared after the health website operator reported better-than-expected revenue and an optimistic outlook for 2013. The stock rose $4.41, or 27 percent, to $20.71.
— Texas Instruments Inc. rose strongly after saying it will increase its dividend by one-third and buy back up to $5 billion more of its own stock. TI gained $1.76, or 5 percent, to $34.23.
Daniel Wagner can be reached at www.twitter.com/wagnerreports .