NEW YORK (Reuters) - U.S. stocks rallied to close out the trading week on Friday as the S&P 500 set a closing record for the third time in five days after an upbeat U.S. jobs report and data on Chinese manufacturing eased concerns about slowing global growth.

Job growth slowed less than forecast in October, as a drag from a strike at General Motors GM.N was made up for in other areas of the labor market, while job gains in the prior two months were stronger than previously thought.

“A nice surprise, and also there were upwards revisions for September and August,” said Jeff Kravetz regional investment strategist at U.S. Bank Wealth Management in Phoenix.

“To us that is an indication of the resiliency of the economy this late in the cycle and for today that is what is putting investors at ease and putting them on a risk-on mode here.”

The strong jobs number helped overshadow a report that showed the manufacturing sector contracted for a third straight month.

Along with the S&P’s new high, the Nasdaq eclipsed its July closing record. The S&P has climbed for four straight weeks, its longest streak since February, while the Nasdaq has gained in five straight weeks as quarterly earnings have come in stronger than anticipated and U.S.-China trade rhetoric has appeared to be productive. The Dow sits less than 12 points from a closing record.

Before the jobs report, sentiment was supported by data showing China manufacturing activity unexpectedly expanded in October, easing concerns about a slowdown in demand from the world’s second-largest economy as a result of U.S. tariffs.

FILE PHOTO: A trader works on the floor at the New York Stock Exchange (NYSE) in New York, U.S., October 31, 2019. REUTERS/Brendan McDermid

The Dow Jones Industrial Average .DJI rose 300.86 points, or 1.11%, to 27,347.09, the S&P 500 .SPX gained 29.36 points, or 0.97%, to 3,066.92 and the Nasdaq Composite .IXIC added 94.04 points, or 1.13%, to 8,386.40.

For the week, the Dow rose 1.44%, the S&P 500 climbed 1.47% and the Nasdaq rose 1.74%.

U.S.-China trade news remained supportive for stocks, as Beijing’s state-media Xinhua News Agency reported the two countries have “reached consensus on principles.” Earlier, U.S. Commerce Secretary Wilbur Ross said the “phase one” trade pact with China appeared to be in good shape.

About 76% of the 356 S&P 500 companies that have reported so far have beaten profit estimates, according to Refinitiv data.

However, profit growth forecasts for the next four quarters have been revised lower, even as expectations for a decline in third-quarter earnings have shrunk to 0.8% from 2.2% at the start of October.

Oil major Exxon Mobil Corp XOM.N rose 3.00% after it beat recently lowered third-quarter profit expectations. The energy sector .SPNY gained 2.50% as the best-performing S&P sector, and oil prices jumped on trade deal progress.

Qorvo Inc QRVO.O jumped 20.23% after the Apple supplier announced a $1 billion share buyback plan and forecast third-quarter revenue above expectations.

But Pinterest Inc PINS.N plunged 17.02% after the online scrapbook company missed quarterly revenue estimates.

Advancing issues outnumbered declining ones on the NYSE by a 2.81-to-1 ratio; on Nasdaq, a 2.86-to-1 ratio favored advancers.

The S&P 500 posted 44 new 52-week highs and two new lows; the Nasdaq Composite recorded 113 new highs and 39 new lows.