NEW YORK—Stocks rallied as upbeat readings on the U.S. economy helped insulate against another steep drop in Japan.

Paul Vigna takes a look at the stocks traders will be watching, including Safeway, Lululemon and Google Getty Images.

Thursday's rally not only broke the first three-day string of declines for the Dow this year, but also marked a shift from recent weeks where strong economic news was seen as a negative for stocks because it could prompt the Federal Reserve to scale back on its efforts to ease monetary policy.

The Dow Jones Industrial Average gained 180.85 points, or 1.2%, to end at 15176.08. The blue chips notched their first advance of this week and more than wiped away a 127-point drop on Wednesday.

The Standard & Poor's 500-stock index tacked on 23.84 points, or 1.5%, to 1636.36. All 10 of the S&P 500's sectors gained ground, led by growth-sensitive consumer-discretionary, materials and energy sectors. The Nasdaq Composite Index advanced 44.93 points, or 1.3%, to 3445.36.

For weeks, global markets have been gripped by concerns that the Fed may start winding down its asset-purchase program, feeding volatility that had been absent for much of this year's stock rally. Worries that the Fed might curtail its stimulus measures based on the pace of economic improvement led to an unusual pattern: positive readings on U.S. economic growth often translated to down days for stocks.

But on Thursday, investors took heart in a pair of better-than-expected readings on the U.S. economy. Retail sales rose 0.6% in May from the month earlier, topping expectations. Separately, initial claims for jobless benefits fell to 334,000 in the latest week from last week's 346,000, a deeper drop than forecast.

Regarding recent chatter that strong data might prompt the Fed to start tapering asset purchases sooner rather than later, which could hurt stocks, Dan Greenhaus, chief global strategist at brokerage firm BTIG in New York said simply: "Good data is good for stocks."

Stock gains accelerated late in Thursday's session after a The Wall Street Journal column suggested that Fed Chairman Ben Bernanke will try to calm investor fears about higher interest rates after next week's policy meeting.

After weeks of choppy trading, Kristina Hooper, head of investment and client strategies at Allianz Global Investors, said that markets appear more willing to embrace positive economic data in the U.S. on its face, rather than as a sign the Fed may pare back its stimulus efforts.

Japan's Nikkei Stock Average slid 6.4% overnight to enter so-called bear-market territory, down more than 20% from its May peak. A rally in the yen to two-month highs against the dollar triggered sharp losses in shares of export-oriented companies.

The recent volatility in Japanese markets, with the Nikkei running up 50% from the end of 2012 through May 22, then falling 20%, has fueled investor anxiety around the world.

Elsewhere in Asia, China's Shanghai Composite reopened from an extended holiday with a 2.8% decline.

European markets declined slightly, with the Stoxx Europe 600 falling less than 0.1%. It recovered from a decline of as much as 1.7% earlier in Europe's trading session.

Front-month July crude oil futures rose 0.8% to $96.69 a barrel, while June gold futures gave up 1% to $1, 377.60. a troy ounce. The dollar fell against the euro and the yen. Yields on benchmark 10-year Treasury notes fell to 2.178% as prices rose.

In corporate news, Belo soared after the television company agreed to be acquired by GannettGCI-1.40% for about $1.5 billion in cash.

Safeway jumped after the grocery-store chain agreed to sell its Canadian operations to Empire Co. subsidiary Sobeys for 5.8 billion Canadian dollars, or about $5.7 billion.

This copy is for your personal, non-commercial use only. Distribution and use of this material are governed by our Subscriber Agreement and by copyright law. For non-personal use or to order multiple copies, please contact Dow Jones Reprints at 1-800-843-0008 or visit www.djreprints.com.