By Anna Isaac and Gunjan Banerji

U.S. stocks edged higher Friday as the latest employment report showed the economy added more jobs than expected last month, though uncertainty surrounding fresh government stimulus threatened to crimp a recovery.

Employers added 1.8 million jobs in July and the unemployment rate fell to 10.2%, according to the Labor Department. Economists surveyed by The Wall Street Journal had projected that payrolls grew by 1.5 million and that the unemployment rate dropped to 10.6% from 11.1% in June.

Investors have also been closely monitoring negotiations among lawmakers regarding fresh government stimulus, after $600 in enhanced weekly unemployment benefits expired, endangering consumer spending and an economic recovery.

Talks between White House officials and Democratic leaders on a new coronavirus-aid package ended late Thursday without a breakthrough as both sides edged closer to the Trump administration's Friday deadline for reaching a deal or leaving the bargaining table. On Friday, those talks were on the brink of collapse.

Fiscal stimulus has been a key driver in the stock market's dramatic recovery since its March lows, and worries that lawmakers wouldn't reach a consensus weighed on markets early Friday, analysts said.

"We have a lot of wood to chop from here," said Chris O'Keefe, a lead portfolio manager at Logan Capital Management.

The S&P 500 rose less than 0.1% in 4 p.m. trading. The Dow Jones Industrial Average gained 47 points, or 0.2%. The Nasdaq Composite shed 0.9%.

July's job growth followed May and June's combined payroll gain of 7.5 million as many states lifted lockdown restrictions on businesses. There are now about 13 million fewer jobs than in February, the month before the coronavirus hit the U.S. economy.

"It shows we're going in the right direction but we're still nowhere close to where we were in February," said Shawn Cruz, senior markets strategist at TD Ameritrade, of the monthly jobs report.

Also hanging in the backdrop are tensions between the U.S. and countries around the globe.

President Trump signed executive orders Thursday night that would bar people in the U.S. or subject to U.S. jurisdiction from transactions with the China-based owners of WeChat and TikTok, effective 45 days from Thursday. That essentially imposes a 45-day deadline for an American company to purchase TikTok's U.S. operations. The orders are likely to be viewed in China as an attempt to stifle the nation's technology sector.

The orders come as relations deteriorate between the two countries, prompting speculation that trade among the world's two largest economies could take a hit.

"China is just about the only bipartisan issue in Washington at the moment," said James Athey, senior investment manager at Aberdeen Standard Investments. "The framework of a Cold War, decoupling and a bi-polar world is the right one to think about. It won't be possible to straddle both China's and the U.S.'s agenda."

In addition, Canada said it would place tariffs on U.S. products that contain aluminum, after President Trump placed tariffs on some Canadian aluminum.

In corporate news, shares of Uber Technologies fell about 6% after the company posted another big loss after market close Thursday, with little sign of recovery in its core ride-hailing business as the pandemic drags on.

Overseas, major markets fell. The Shanghai Composite dropped 1%, while Hong Kong's Hang Seng Index fell 1.6% and Japan's Nikkei 225 index dropped 0.4%.

The yield on the benchmark 10-year U.S. Treasury note ticked up to 0.557%, from 0.535% Thursday. Yields rise as bond prices fall.

Gold prices slipped on Friday but finished the week with gains. Front month gold futures gained $47.30 per troy ounce, or 2.4%, to $2010.10 this week. It was the ninth consecutive week of gains, the longest such stretch since 2006.

Write to Anna Isaac at anna.isaac@wsj.com and Gunjan Banerji at Gunjan.Banerji@wsj.com