US stock markets posted solid gains in a seesaw week of trade that was dominated by Facebook's post-IPO slump and heightened fears of a Greek euro exit and Spanish banking crisis.
The Dow Jones Industrial Average finished the week up 0.7 percent, the S&P 500 gained 1.7 percent and the Nasdaq ended the week 2.1 percent higher as investors sought the relative safety of US stocks.
On Friday the Dow closed at 12,454.83 points, the S&P at 1,317.82 and the Nasdaq at 2,837.53.
The week was marked by summits of the Group of Eight and European Union which saw little progress toward halting Europe's seemingly interminable debt crisis, which looks like it could force Greece out of the eurozone.
"The rhetoric in Europe has heated up in recent days, amid signs that several countries and institutions have contingency plans in the event of a Greek exit," said analysts at Barclays Capital.
The G8 and EU leaders separately said they wanted Greece to remain in the eurozone, but announced few concrete steps to make that happen.
On June 17 Greeks will go back to the polls. If voters again back parties opposed to the terms of a massive bailout, then markets are betting funding could quickly stop and a default and eurozone exit could follow.
Concerns about the eurozone were compounded by events in Spain.
On Friday the Spanish stock market suspended trade in Bankia's plunging shares as the struggling lender asked the government for 19 billion euros ($24 billion) in what would be the largest bank bailout in the country's history.
In a statement, the bank said its board had approved a recapitalization plan which will allow it "to meet all applicable regulatory requirements and confront a more adverse macroeconomic context."
Throughout the week there was heavy action in the tech sector.
Facebook faced a pile of lawsuits over its IPO debacle Friday, leaving shares down almost 17 percent to end the week at $31.91, well below the original issue price of $38.
Computer maker Dell, once the market leader, dived over 15 percent after posting a 33 percent drop in profits and falling revenue for its fiscal first quarter.
Hewlett-Packard shares surged four percent after it announced a major restructuring effort involving shedding 27,000 jobs, or eight percent of its global workforce.
Google sank 1.5 percent despite Chinese antitrust regulators signing off on the company's $12.5 billion purchase of Motorola Mobility.
Next week attention will turn back to the United States, with a revision to economic growth figures on Thursday and key May unemployment data on Friday.
"Markets should remain focused this week on the final employment report to be released prior to the June FOMC meeting," said Nomura analysts referring to the June 19-20 meeting of the Federal Reserve's interest rate-setting panel.
US markets are closed on Monday for the Memorial Day holiday.