NEW YORK (CNNMoney) -- — The S&P and Nasdaq wrapped up their worst weeks of 2013, but the Dow managed to end the week with a slight gain.
Stocks rose Friday, with the Dow jumping more than 100 points to close above 14,000. Better-than-expected results from Hewlett-Packard and AIG pushed investors back into the stock market.
The Dow Jones Industrial Average, S&P 500 and Nasdaq gained between 0.8% and 1%. The S&P and Nasdaq lost 0.3% and 1% respectively for the whole week, while the Dow gained 0.1%.
Friday's gains followed a selling streak that marked the biggest two-day drop for U.S. stocks this year.
The pullback is not unusual though, given how well the market has done so far this year. Investors rushed back into stocks at the beginning of the year, and continue to add money to the U.S. stock market, but at a much more tempered pace.
CNNMoney's Fear & Greed Index has also eased into greed (it had been stuck in extreme greed since the start of the year). And the market's other fear gauge, the VIX, has jumped more than 17% over the past five days, although it still has a ways to go before it crosses deep into fear mode.
Despite the recent losses, the Dow is still up nearly 6% since the beginning of the year, the S&P 500 has gained 5% and the Nasdaq is up almost 4%.
Shortly before the close of trading, a federal court ruled against Apple and in favor of hedge manager David Einhorn, who has been pushing the company to do more with its cash. The ruling means that a shareholder vote on whether the company can offer preferred shares to give back cash to shareholders, currently scheduled for next week, could be blocked. Apple's shares closed up 1%.
Hewlett-Packard was the biggest gainer in the S&P 500 Friday. Shares rose 12% after Hewlett Packard reported better-than-expected results late Thursday. HP's first-quarter profit fell 11% from a year ago, and sales declined 6%, but expectations were so low that the figures easily trumped forecasts.
AIG also reported better-than-expected earnings late Thursday, pushing the stock up 3%.
Shares of WebMd spiked more than 25% after the company's restructuring plan started to show results.
Abercrombie & Fitch shares dropped after the retailer said sales at stores open more than one year dropped in the fourth quarter.
Shares of Texas Instruments popped after the company increased its dividend and announced share buybacks.
European markets closed mixed after a big sell-off Thursday. Investors remained cautious after the European Commission predicted that the eurozone economy would continue to shrink in 2013. Investors are also waiting to see the results from a key election in Italy this weekend.
Asian markets ended mixed. Japan's Nikkei added 0.7%, while the Shanghai Composite and Hang Seng lost 0.5%.
Gas prices have risen for 36 straight days. Nationwide, a gallon of unleaded gasoline cost an average of $3.78 Friday, according to AAA. That's up 49 cents, or 15% since Jan. 18, when prices started rising.
Oil prices edged higher while gold prices declined.
The dollar gained ground against the British pound, the euro and the Japanese yen.
The price on the 10-year Treasury increased slightly, pushing the yield down to 1.97% from 1.98% Thursday.
™ & © 2013 Cable News Network, Inc., a Time Warner Company. All rights reserved.