Updated

Mild economic data gave Wall Street a moderate gain Thursday as stocks survived a round of profit-taking ahead of the Labor Department's June employment report. A favorable court ruling for Altria Group Inc. (MO) lifted the Dow Jones industrials.

The market got an initial boost from economic and retail sales data that fed optimism about an end to the Federal Reserve's string of interest rate hkes. But traders were already looking ahead to Friday's employment report — widely seen as a key indicator of the economy's health — prompting some to hedge their bets and lock in profits.

Click here to visit FOXBusiness.com's Investing page.

With the Fed recently signaling that it could be done raising rates, upcoming economic data and corporate earnings will be critical for stocks. In Friday's jobs report, numbers too far above or below expectations could reignite worries about inflation and economic growth, said Ken Tower, chief market strategist for Schwab's CyberTrader.

"It's really a fine line," Tower said. "Too much good news fires up this inflation fear and suggests the Fed will have to keep raising rates. Too much of a slowdown threatens profits."

The Dow gained 73.48, or 0.66 percent, to 11,225.30, after rising almost 105 points earlier. The Dow slumped 76 points Wednesday amid concerns about North Korea's missile launch and soaring oil prices.

Broader stock indicators ended slightly higher. The Standard & Poor's 500 index added 3.17, or 0.25 percent, to 1,274.08, and the Nasdaq composite index rose 1.75, or 0.08 percent, to 2,155.09.

Bonds rose, with the yield on the 10-year Treasury note dropping to 5.18 percent from 5.22 percent late Wednesday. The U.S. dollar fell against the Japanese yen, and gold prices edged up to about $635 an ounce.

Oil futures steadied after nervousness about tensions with North Korea and gasoline supplies propelled prices to a new intraday high Wednesday. Although a government report on Thursday showed shrinking crude reserves, inventories of refined products increased. A barrel of light crude lost 5 cents to $75.14 on the New York Mercantile Exchange.

In economic news, the Institute for Supply Management said its services index fell 3.1 points to 57, below economists' forecast of 59. A sharp drop in the index's prices paid component helped soothe inflation fears.

First-time applications for jobless benefits slipped by 2,000 to 313,000 last week, the Labor Department said. Fewer average claims in June suggested a possible rebound in monthly job growth, the department noted.

And after the market digests Friday's employment data, the second-quarter earnings season gets under way next week with results from aluminum producer Alcoa Inc. Monday. Investors will be looking for the impact of higher energy prices and interest rates on corporate profits.

"It's no secret we're looking at another round of solid data and double-digit returns," said Peter Cardillo, chief strategist for S.W. Bach & Co. "Some of that is probably already priced into the market. It will likely lead us to a slightly higher trading range in the coming weeks."

Retailers reported slower sales growth last month, a sign that high gasoline prices and rising lending rates are limiting consumer spending. Investors have been expecting a consumer slowdown to take the economy with it.

The results nonetheless dragged on some stocks. Dow component Wal-Mart Stores Inc. (WMT), whose low-income customers are most vulnerable to high energy costs, said its sales rose 1.2 percent in June, below estimates of 2 percent. Wal-Mart dropped 30 cents to $46.72.

Rival discounter Target Corp. (TGT) posted sales of 4.8 percent to top predictions of 4.3 percent. Target gained 90 cents to $49.17.

JCPenney Co. (JCP) saw a 4.3 percent rise in same-store sales, easily beating forecasts of 2.8 percent. Penney added 27 cents to $67.65.

Elsewhere, cigarette makers rallied after the Florida Supreme Court dropped a $145 billion (euro114 billion) verdict against tobacco companies, saying the award was excessive. Altria surged $4.43 to $77.76; Reynolds American Inc. jumped $4.59 to $118.95.

Advancing issues led decliners by 5 to 3 on the New York Stock Exchange, where volume of 1.42 billion shares lagged the 1.52 billion shares that changed hands Wednesday.

The Russell 2000 index of smaller companies rose 0.79, or 0.11 percent, to 720.64.

Click here to visit FOXBusiness.com's Investing page.