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(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(AAPL) 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(HPQ) 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(AIG) also reported better-than-expected earnings late Thursday, pushing the stock up 3%.
Shares of WebMd(WBMD) spiked more than 25% after the company's restructuring plan started to show results.
Abercrombie & Fitch(ANF) shares dropped after the retailer said sales at stores open more than one year dropped in the fourth quarter.
Shares of Texas Instruments(TXN) popped after the company increased its dividend and announced share buybacks.
AIG is no longer cursed
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.
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.