U.S. equity indexes closed higher on Friday after the government unveiled a much better-than-expected jobs data for November, allaying fears about the labor market.

The Dow Jones Industrial Average gained 336.9 points to 28,014.69 while the S&P 500 jumped 28.47 points to 3,145.9 and the Nasdaq Composite Index rose 85.83 points to 8,656.53.

For the week, the Dow and S&P 500 both finished essentially flat.

Friday’s volume on the New York Stock Exchange totaled 2.81 billion shares with 2,198 issues advancing, 154 setting new highs, and 762 declining, with 14 setting new lows.

Active movers were led by Bank of America (BAC), General Electric (GE) and Plug Power (PLUG)

The U.S. added 266,000 new jobs in November, the biggest such increase since January, suggesting a strong labor market. Economists had expected a gain of 180,000 jobs. The unemployment rate fell to 3.5%, a 50-year low, while average wages edged up 0.2% to $28.29 an hour. Hours worked each week remained flat at 34.4 hours. The Labor Department also revised October’s job gains to 156,000 from 128,000.

“Today’s jobs report should have the Fed feeling good about the current stance of policy of remaining on hold at 1.5%-1.75%,” said Bank of America Merrill Lynch economist Michelle Mayer. “Moreover, the strong employment activity suggests that the economy is in a better spot than previously thought to withstand any potential drag from the U.S.-China trade war and other geopolitical risks in the outlook.”

The University of Michigan's preliminary consumer sentiment index for December jumped to 99.2 -- a seven-month high -- from 96.8 in November, beating most forecasts.

Wholesale inventories in the U.S. edged up 0.1% in October, following a sharp decline in September. However, sales fell by 0.7% in November.

Meanwhile, China’s finance ministry said Friday it is working to waive tariffs on imports of U.S. soybeans, cotton, corn, sorghum and pork by domestic companies, a measure that could help to facilitate the larger trade agreement with the U.S.

Larry Kudlow, the White House National Economic Council director, told CNBC the U.S. and China are “close” to a trade pact, but President Trump could walk away if he doesn’t get terms he wants.

“The president has said many times if the deal is no good, if the assurances with respects to preventing future thefts, if the enforcement procedure is no good he has said we will not go for it. We will walk away,” Kudlow said. “The president has said that if we cannot get the enforcement and the assurances, then we will not go forward.”

But Kudlow added: “The deal is close. It’s probably even closer than in mid-November.”

Kudlow also told Bloomberg TV there is no single condition that would make or break trade talks with China. He further said there are no arbitrary deadlines on when to reach such a deal.

Consumer credit increased by $18.9 billion in October, up from a $9.6 billion gain in the prior month. Forecasters had expected a $15 billion rise in October.

Overnight in Asia, markets all finished higher. The Hang Seng rose 1.07% while Japan’s Nikkei-225 climbed 0.23% and China’s Shanghai Composite advanced 0.43%.

European markets were all higher with the FTSE 100 up 1.24% while Germany's DAX rose 0.84% and France's CAC 40 climbed 1.1%.

Crude oil futures gained 1.01% to $59.02 per barrel and Brent crude slipped 0.25% at $64.23. Gold futures fell 1.2%.

The euro slipped 0.38% to $1.1061 while the pound sterling was off 0.17% at $1.3136.

The yield on the 10-year Treasury rose 2.5% to 1.842% while yield on the 30-year Treasury gained 1.65% to 2.284%.