"We're walking a tight wire with the Fed," said Rob Lutts, Chief Investment Officer at Cabot Money Management. He said the jobs report was positive because it showed the economy was improving, but perhaps not strongly enough to assure that the Fed will pull back on its bond-buying program before the end of year.
The Dow gained 167.80 points, or 1.1 percent, to 15,761.78. It also closed at a record high on Wednesday.
The Standard & Poor's 500 index ended 23.46 higher, or 1.3 percent, at 1,770.61, just a point below its record. The Nasdaq composite rose 61.90 points, or 1.6 percent, to 3,919.23.
Both the Dow and S&P 500 recovered all of their losses from Thursday, when concern about the Fed withdrawing its stimulus outweighed optimism about faster economic growth.
The reaction to the jobs news was more pronounced in the Treasurys market. The yield on the 10-year Treasury note jumped to its highest level in six weeks as investors sold Treasurys, anticipating less demand if the Fed slows its purchases. Rising interest rates are a sign that investors are more confident in the economy. They are a boon to banks because it means that they can lend money at higher rates.
The yield on the 10-year note jumped from 2.60 percent on Thursday to 2.75 percent Friday, the highest level since Sept. 20. JPMorgan Chase rose $2.31, or 4.5 percent, to $53.96. Bank of America gained 52 cents, or 3.8 percent, to $14.32.
Housing stocks were among the biggest decliners on Friday.
Rising Treasury yields lead to higher mortgage rates, and that can hurt demand for homes. Lennar fell $1.45, or 4.2 percent, to $32.79. PulteGroup dropped 66 cents, or 3.8 percent, to $16.85.
The government reported that U.S. employers added 204,000 jobs in October, an unexpected burst of hiring during a month in which the federal government was partially shut down for 16 days. The job additions were far greater than the 130,000 economists were expecting, according to FactSet, a financial data provider.
The jobs report was the second piece of robust economic news that Wall Street received in the past two days. The Commerce Department said Thursday that the U.S. economy grew at an annual rate of 2.8 percent in the third quarter, better than the 2.5 percent economists expected.
The Fed has been buying $85 billion worth of bonds each month since last December to keep long-term interest rates low and encourage hiring and borrowing. The program has also helped drive up stock prices by making bonds look expensive by comparison.
Some analysts say the Fed's role in the stock market surge has been overstated, compared with factors such as rising corporate earnings. Removing the stimulus would likely benefit the economy by eliminating one of the uncertainties facing U.S. businesses, said Liz Ann Sonders, chief investment strategist at Charles Schwab.
"It's time we rip the Band-Aid off," Sonders said. "If it's the data that supports it, all the better."
Almost 90 percent of the companies in the S&P 500 have reported results for the third quarter. Earnings are expected to rise 5.6 percent, compared with 4.9 percent in the second quarter and 2.4 percent a year earlier.