NEW YORK — U.S. stocks edged up on Thursday, rising for a third day after strong data indicated improving economic conditions, with caution capping gains ahead of Friday’s payrolls report and its implication on the Federal Reserve’s stimulus program.

Markets continue to deal with the possibility of a U.S.-led strike against Syria, and President Barack Obama faced growing pressure at the Group of 20 summit in Russia not to use military force.

Growth in the U.S. services sector accelerated in August to its fastest pace in almost eight years, while new jobless claims last week fell to a near five-year low. The data bolstered views the Fed could start slowing its bond-buying program as soon as this month.

The equity market is showing resilience in the face of a possible bombing of Syria and a smaller Fed stimulus due to the underlying strength in the economy, said King Lip, chief investment officer at Baker Avenue Asset Management in San Francisco.

He said the case for winding down the Fed’s $85 billion a month in asset purchases “is stronger than it has ever been,” with Friday’s jobs report the tipping point for the decision.

The Dow Jones industrial average rose 6.61 points or 0.04 percent, to 14,937.48, the S&P 500 gained 2 points or 0.12 percent, to 1,655.08 and the Nasdaq Composite added 9.743 points or 0.27 percent, to 3,658.785.

The strong data and expectations for the Fed’s taper triggered a selloff in bonds, with the benchmark 10-year Treasury yield brushing against 3 percent. Analysts said the recent bond selloff could persist.

The ADP National Employment report showed U.S. private employers added 176,000 jobs in August, nearly matching expectations, while weekly initial jobless claims fell more than expected to a seasonally adjusted 323,000.

Fastenal Co rose 6 percent to $48.60 as the best performer on the S&P 500 after the seller of industrial and construction supplies reported a jump in August net sales as well as an increase in customers.

Retail stocks rose as many U.S. retailers reported stronger-than-expected August sales, but had to use steep discounts to attract back-to-school shoppers.

Costco Wholesale Corp reported same-store sales that beat expectations despite lower fuel prices, sending shares up 2.8 percent to $114.62. The Morgan Stanley retail index gained 0.6 percent.

Shares of Martha Stewart Living Omnimedia dropped 5.7 percent to $2.32 after a New York Post report that J.C. Penney is scrapping a line of products that rival Macy’s has claimed violated its contract with Martha Stewart. J.C. Penney shares rose 5.3 percent to $14.22 and Macy’s added 2.7 percent to $46.02.

In merger news, Kaydon Corp shares jumped 23 percent to $35.55 after Sweden’s SKF agreed to acquire it for $1.25 billion.

About 5.3 billion shares changed hands on the New York Stock Exchange, the Nasdaq and NYSE MKT, below the daily average so far this year of about 6.26 billion shares.

On the NYSE 1,413 issues rose and 1,578 fell, while on Nasdaq about three issues rose for every two decliners.