A wave of corporate deals and generally positive quarterly earnings competed for attention this week with gloomy news developments in Ukraine and Gaza, ultimately leading US stocks higher.
For the week, the Dow Jones Industrial Average advanced 156.37 points (0.92 percent) to 17,100.18.
The broad-based S&P 500 rose 10.65 (0.54 percent) to 1,978.22, while the tech-rich Nasdaq Composite Index gained 16.66 (0.38 percent) to 4,432.15.
The week's gains came despite twin crises that emerged Thursday when a Malaysian airliner carrying 298 people crashed in Ukraine in a disaster that US officials said was likely caused by a missile shot from an area of Ukraine controlled by pro-Russia separatists.
Only hours after the plane crashed, Israel launched a ground operation in Gaza, lifting the Palestinian death toll to 296 Friday, the 11th day of assault that Israel argues is needed to counter Hamas's terrorist efforts.
US stocks nose-dived Thursday, but surged Friday even as the US sharpened criticism of Russia's actions in Ukraine and as Israel warned of a wider Gaza assault.
"The negativity is being shrugged off for the most part," said Michael James, managing director of equity trading at Wedbush Securities.
The market is showing "tremendous amounts of resilience," he added.
"Investors are continuing to embrace risk and buy every dip," said David Levy, portfolio manager at Kjolen Capital Management.
The market is giving greater weight to positive economic news compared with geopolitical threats like Ukraine, where the economic implications are murky and there is little obvious potential for a "prolonged impact on corporate America," according to Levy.
"The economy is continuing to show signs of improvement," Levy said. "We're seeing strong corporate profitability as well as strong merger and acquisition activity. That's why the market is able to shrug off geopolitical news."
-Big deals, big earnings-
Major deals this week included a plan unveiled by US tobacco giant Reynolds American to acquire rival Lorillard for $27.4 billion and sell cigarette brands including Salem and Winston to British firm Imperial Tobacco for $7.1 billion.
US pharmaceutical giant AbbVie sealed a $54 billion takeover of Dublin-based Shire Pharmaceuticals, which had opposed earlier bids.
Whiting Petroleum announced plans to acquire Kodiak Oil & Gas for $6 billion, while Abbott Laboratories sold its branded generics drugs for developed markets to generic drugmaker Mylan for stock valued at $5.3 billion.
Rupert Murdoch rocked the media world when his entertainment company, 21st Century Fox, offered $80 billion for Time Warner. Time Warner turned down the bid, but Murdoch is "determined to buy Time Warner," according to a person familiar with the matter.
Technology giants IBM and Apple, while avoiding show-stopping mergers, announced what they called a "landmark" partnership to collaborate on applications for Apple's iOS system, which will employ IBM's supercomputing analytics.
Analysts were also smiling at the early results from earnings season.
Standouts included Dow component Intel, which raised its profit forecast and announced $20 billion in additional share repurchases; Google, which notched a 22 percent increase in revenues behind a surge in "paid clicks"; and Goldman Sachs, which reported $4.10 per share in earnings, beating analyst expectations by more than a dollar.
"It's been a very good earnings season," said Gregori Volokhine, president of Meeschaert Capital Markets. "There were lots of doubts about it earlier."
Through Friday afternoon, 84 companies in the S&P 500 reported earnings, with 56 beating analyst expectations, 15 missing and 13 meeting projections, according to S&P Capital IQ.
Next week's earnings calendar is also busy and includes giants like Apple, Microsoft, Boeing, Facebook, McDonald's and American Airlines.
The schedule of economic indicators includes reports on existing-home sales, new home sales and durable goods orders.