Stocks advanced on Friday as a standby aid package announced by euro zone leaders eased worries about Greece's debt problems and U.S. consumer sentiment data signaled the recovery was intact.

Euro zone leaders unveiled a deal late Thursday in which Athens would receive coordinated bilateral loans from other euro zone countries and the International Monetary Fund if it faced severe difficulties.

Commodity-related shares, including Chevron Corp , rose as the dollar slipped against the euro. Worries about hefty debt loads of some euro zone countries have pressured equities, and the agreement relieved uncertainty about the European Union's dealing with the problem.

Having the Greek situation come under control is very comforting to investors, said Charles Lieberman, chief investment officer of Advisors Capital Management, LLC in Paramus, New Jersey. They don't want problems in Greece to spread.

The Dow Jones industrial average <.DJI> was up 50.56 points, or 0.47 percent, at 10,891.77. The Standard & Poor's 500 Index <.SPX> was up 5.59 points, or 0.48 percent, at 1,171.32. The Nasdaq Composite Index <.IXIC> was up 7.92 points, or 0.33 percent, at 2,405.33.

Consumer sentiment was unchanged in March from February, but was slightly above expectations. A separate report showed gross domestic product grew by 5.6 percent in the fourth quarter, dipping from the preliminary estimate of 5.9 percent a month ago.

Home insurers and builders got a boost after the Obama administration announced a $14 billion effort to relieve the flood of home foreclosures by giving lenders incentives to erase some mortgage debt and slash mortgage payments for the unemployed.

The KBW mortgage finance index <.MFX> gained 1.3 percent, while mortgage insurer MGIC Investment Corp jumped 7.9 percent to $9.62. The broader S&P financial index <.GSPF> rose 1.3 percent.

Apple Inc lifted the Nasdaq after Credit Suisse raised its price target to $300 from $275, saying the iPhone maker is seeing a stronger second quarter than earlier thought. The stock rose 2.1 percent to $231.41.

Dollar-denominated commodities, and shares related to those prices, tend to rise as the dollar falls.

(Additional reporting by Leah Schnurr; Editing by Kenneth Barry)