U.S. stocks closed higher Friday, boosted in the last hour of trading after eurozone officials agreed to launch a new bailout program for Greece. Nine of the 10 S&P 500 sectors traded higher, led by gains in financial and utility stocks, while energy was the only laggard, down just 0.2 percent.

The Dow Jones Industrial Average (INDEXDJX:.DJI) gained 69.15 points, or 0.40 percent, to 17,477.40. The Standard & Poor's 500 index (INDEXSP:.INX) added on 8.15 points, or 0.39 percent, to 2,091.54. And the Nasdaq composite (INDEXNASDAQ:.IXIC) rose 14.68 points, or 0.29 percent, to 5,048.23.

U.S. stocks received a boost after eurozone officials agreed to launch a new bailout program for Greece of up to 86 billion euros ($95 billion) over three years, the country's third bailout in five years, the European Commission confirmed Friday. The bailout bill passed through the Greek Parliament Thursday and will face a vote from the Parliament in Germany, the largest contributor of funds, next week.

Investors also sorted through a series of data points Friday that showed U.S. wholesale prices recorded back-to-back-to-back gains in July, while consumer sentiment edged mildly lower in August for a second month.

Wall Street managed to stage a comeback this week after the Dow experienced multiple bouts of volatility, plunging more than 200 points in intraday trading on Tuesday and Wednesday after China devalued the yuan by more than 3 percent against the U.S. dollar in an effort to revive the world's second-largest economy.

For the year, the Dow has lost 344 points, or nearly 2 percent. However, the S&P 500 has added 33 points, or 1.6 percent, and the Nasdaq composite has gained 312 points, or 6.6 percent, so far this year.

Chemical maker DuPont Co. (NYSE:DD) and network equipment maker Cisco Systems Inc. (NASDAQ:CSCO) led the Dow higher Friday, gaining 1.6 percent and 1.2 percent, respectively.

Shares of El Pollo LoCo Holdings Inc. (NASDAQ:LOCO) plunged 20 percent Friday, hitting a 52-week low of $14.55 after the Mexican-style restaurant chain lowered sales projections for the year.