Wall Street rose on Friday following a report on economic growth which met expectations and on hopes for further stimulus from the Federal Reserve and the European Central Bank.

Economic growth slowed, as expected, in the second quarter as consumers spent at their most sluggish pace in a year. The figure was better than investors' worse fears but still weak enough to potentially push the Fed closer to pumping more money into the economy.

"You're in that spot where bad news is good news, as long as it's not atrocious or horrible," said Gordon Charlop, a managing director at Rosenblatt Securities in New York. "If there's bad news and it forces the Fed to do something, to stimulate, it's actually a positive."

Stocks leapt nearly 2 percent on Thursday, erasing much of the losses for the week, after European Central Bank chief Mario Draghi said he would do whatever it takes to save the euro. That followed a story in the Wall Street Journal earlier in the week, which was seen as heralding a new round of stimulus by the Fed.

Amazon.com (AMZN.O) shares rose 5.7 percent to $232.55 after reporting improved profit margins Thursday after the market closed. The company said the improvement was due to growth in its third-party merchant hosting and cloud computing services, which are more profitable than its retail operations.

Facebook Inc (FB.O) shares tumbled 14 percent, hitting an all-time low of $22.28, a day after it reported a drastic slowdown in revenue growth and failed to offer financial forecasts that eased fears about its ability to boost advertising growth.

The Dow Jones industrial average .DJI gained 102.89 points, or 0.80 percent, to 12,990.82. The Standard & Poor's 500 Index .SPX rose 14.42 points, or 1.06 percent, to 1,374.44. The Nasdaq Composite Index .IXIC climbed 32.19 points, or 1.11 percent, to 2,925.44.

Merck & Co (MRK.N) provided the biggest boost to the Dow after it reported better-than-expected quarterly earnings despite a stronger dollar, with robust sales growth of its vaccines and treatments for diabetes and HIV. The shares rose 3.1 percent to $44.68.

Optimism over further stimulus measures has helped offset a mixed corporate earnings season, with many companies beating profit forecasts but often missing revenue projections and warning about sluggish global growth.

Through Friday morning, of the 290 in the S&P 500 that have reported earnings to date for Q2 2012, about two-thirds have reported earnings above analyst expectations, according to Thomson Reuters data.

Starbucks Corp (SBUX.O) cut its outlook for the current quarter, citing global economic weakness and a recent slowdown in visits in the United States, its biggest market for sales and profits, sending shares tumbling more than 10.9 percent to $46.67.

Gross domestic product expanded at a 1.5 percent annual rate between April and June, the weakest pace of growth since the third quarter of 2011, the Commerce Department said on Friday.