By Dan Strumpf And Saumya Vaishampayan 

Stocks ended slightly lower Thursday as an early rally ran out of steam, even after the U.S. jobs report reaffirmed investors' belief that the Federal Reserve would be patient in raising interest rates.

The Dow Jones Industrial Average fell 27.80, or 0.2%, to 17730.11, reversing a gain of as much as 68 points earlier in the session. The S&P 500 index lost 0.64 point, less than 0.1%, to 2076.78. The Nasdaq Composite Index declined 3.91, or 0.1%, to 5009.21.

The Labor Department said 223,000 jobs were added to the U.S. economy in June, while the unemployment rate fell to 5.3% from 5.5%. The number of new jobs created came in just below expectations for 233,000, while wages remained flat.

Still, the report marks the 14th out of the last 16 months in which the economy added more than 200,000 jobs. Investors closely track the monthly jobs report, which is also taken into consideration by the Federal Reserve as it determines its course on interest rates.

"It's a solid report, not overly strong, but exactly what the Fed will need to continue to justify the case for liftoff later this year," said Darrell Cronk, president of Wells Fargo Investment Institute.

Despite taking comfort from the monthly jobs data, some investors remained uneasy bidding up stocks ahead of the long Fourth of July weekend in the U.S., particularly given the looming Sunday referendum in Greece over the country's bailout terms. Major stock benchmarks have been buffeted for weeks by events in Greece.

"It's not a surprise that we did not keep the earlier gains, especially with the uncertainty over the weekend," said Mark Kepner, managing director of sales and trading at brokerage Themis Trading.

Ultralow U.S. interest rates have helped to underpin a rally in stocks and bonds since the 2008 financial crisis, and some investors have been concerned about what a rate increase would mean for financial markets. Citing improvement in the U.S. economy and labor market, the Fed has signaled that it could raise rates as soon as this year, with many economists pegging September for the so-called liftoff.

Pulling ahead of the broader market was the utilities sector, which investors often flock to for income as bond yields fall. Utilities companies in the S&P 500 rose 1.2%.

While the number of jobs created in June fell slightly short of expectations, the level indicated that the U.S. economy continued to expand steadily last month. However, wage growth came in weaker than expected, calling the timing of any interest-rate increase into question. Fed officials have said they want to see inflation, which is driven partly by wage growth, move higher before raising rates.

"You had the surprise in the wage inflation, which cast some doubt over a rate increase in September," said Zhiwei Ren, managing director and portfolio manager at Penn Mutual Asset Management Inc., which has $20 billion assets under management.

Fed-funds futures, used to place bets on central bank policy, showed Thursday that investors and traders see a 10% likelihood of a rate increase at the September meeting, compared with 17% before the jobs report, according to CME Group.

The odds for a rate increase at the December meeting were 49%, compared with 59% before the data.

The diminished odds for a September liftoff sent the dollar falling against both the euro and the yen. The dollar weakened 0.3% against the common currency, with one euro buying $1.1084 in late-afternoon trade. The U.S. currency fell against the Japanese currency to Yen123.10, now 0.1% lower for the day.

Still, the dollar made small gains over the course of the week. The Wall Street Journal Dollar Index, which compares the dollar against 16 other currencies, rose just 0.5% for the week.

The jobs report drew investors' attention back to the U.S. on Thursday. The collapse in talks between Greece and its creditors last weekend and the country's failure to make a payment to the International Monetary Fund sent stocks sliding this week. The S&P 500 lost 1.2% in the week. The index is still up 0.8%.

European stocks deepened their losses ahead of this weekend's vote in Greece. Germany's DAX lost 0.7% on Thursday. France's CAC-40 fell 1%.

Chinese markets tumbled Thursday despite Beijing's attempts to relax rules. The Shanghai Composite closed down 3.5% while the smaller Shenzhen market was down 5.6%.

In commodity markets, gold futures lost 0.5% to $1163 an ounce. Crude-oil futures lost 0.1%to $56.93 a barrel.

Meanwhile, shares of Tesla Motors Inc. rose 4% after the electric car maker said it delivered 11,507 Model S sedans in the second quarter of the year, a 52% increase over the prior-year period and a company record.

Min Zeng contributed to this article.

Write to Dan Strumpf at daniel.strumpf@wsj.com and Saumya Vaishampayan at saumya.vaishampayan@wsj.com