NEW YORK — Stocks ended with a surge Friday after traders decided that a healthy job market mattered more than the Federal Reserve scaling back its economic stimulus.
After the government reported strong hiring for June, traders and investors struggled over how to react. At first, they pushed stocks higher because the report was better than expected. Then they pushed stocks lower because improved hiring last month made it more likely the Federal Reserve could ease back on its bond buying.
After waffling early, investors and traders finally settled on an optimistic outlook. The Standard & Poor's 500 had its strongest performance in three weeks.
"In general, I think our economy is standing on its own two feet right now," said David Brown, chief market strategist at Sabrient, a Santa Barbara, Calif., research firm for institutional investors.
U.S. stock indexes shot higher when the market opened, fueled by the Labor Department's report that the U.S. economy added a stronger-than-expected 195,000 jobs last month. But the gains tapered off within the hour, and all the major indexes dipped briefly into the red.
By the end of the day, the three main U.S. indexes had more than recovered, each ending about 1 percent higher.
The Dow Jones industrial average rose 147.29 points to 15,135.84. The S&P 500 rose 16.48 points to 1,631.89. The Nasdaq composite climbed 35.71 to 3,479.38.
"I think the initial reaction was, 'Yay, all these people are employed, and then, 'whoops,'" Brown said, during late-morning trading.
The whiplash day illustrated the complex and outsized role that the Fed has played in the stock market in recent weeks.
The Federal Reserve, led by Chairman Ben Bernanke, has been propping up the economy by buying bonds and keeping interest rates low. Investors know that the Fed isn't going to continue the stimulus forever, but they worry that developments like Friday's positive jobs report could make the Fed yank away the stimulus too soon.
The jobs picture "gives Bernanke more of a mandate" to rein in Fed stimulus programs, Brown said.
Investors will get other clues about the economy next week, when earnings season starts. Aluminum giant Alcoa reports second-quarter results after the market closes Monday
As investors bought stocks, they sold bonds Friday, another sign that they think the Fed will tamp down its bond buying. The yield on the 10-year Treasury note jumped dramatically to 2.73 percent from late Wednesday's level of 2.51 percent. That was the highest yield for the 10-year note since August 2011.
Relatively few shares changed hands Friday because many traders were still on vacation after the Fourth of July holiday Thursday. Light volume may have contributed to the market's early volatility. The market can be moved by changes in even a relatively small numbers of shares.
Traders also noted that U.S. stock indexes were playing catch-up after missing out on Europe's big gains Thursday.
Stocks in Europe had jumped Thursday, including a 3 percent gain in Britain's main index, after the European Central Bank and the Bank of England sought to soothe markets by saying they'd keep interest rates low for the foreseeable future. Investors there have been scared that their own central banks may follow the Fed's lead and rein in their economic stimulus measures soon.
The calming effect didn't last long. Markets were down throughout Europe on Friday, as investors there fretted over whether the Fed would pull back.
As for U.S. government bond trading, investors have been selling 10-year Treasurys for weeks in anticipation of a Fed pullback. As recently as May 3, the yield on the 10-year note was 1.6 percent. The current yield, while still low by historical standards, has created a sea change in the way investors view bonds.
Jordan Waxman, managing director and partner at HighTower, a wealth management firm in New York, said investors who had fled to bonds because they seemed safe weren't exactly soothed by their recent performance.
"It's like going to your favorite restaurant month in and month out, and then one day you see a rodent running across the restaurant," Waxman said. "It's going to be a while before you go back."
For the past three decades, bond interest rates have tended to move down rather than up, so the recent gains are throwing many investors for a loop, noted Craig Fehr, an investment strategist at Edward Jones in St. Louis.
"This is catching a lot of bond investors off guard," said Fehr. He's been telling clients to trim their holdings on long-term bonds.
The effects of potentially higher interest rates were evident throughout financial markets Friday. Stocks for small banks rose because investors believe those companies will benefit from being able to charge higher rates when they make loans
But homebuilder Lennar was the second-biggest decliner on the S&P 500, falling $1.42, or 4 percent, to $33.93. Investors worried that higher interest rates will make mortgages more expensive and tamp down on demand, although rates will still be low by historical standards.
The price of oil rose $1.98, or 2 percent, to $103.22 a barrel in New York. That could signal investors are optimistic about U.S. manufacturing and the broader economy — or it could mean they're unnerved by political unrest in Egypt. On Wednesday, the Egyptian military ousted President Mohammed Morsi, and his supporters began a series of protests and attacks Friday.
The dollar rose, which likely means that investors were feeling confident about the U.S. economy.
As for the U.S. jobs report, investors said it represented an economy on the mend.
The 195,000 additional jobs in June handily beat expectations for an increase of 165,000. The government also said that the economy added 70,000 more jobs in April and May combined than previously thought.
But there were also reasons for caution. More than half the job additions came from hotels, restaurants, entertainment and retail, which are usually lower paying.
Among stocks making big moves:
—KB Home fell 64 cents, or 3.4 percent, to $18.07. Beazer Homes lost 18 cents, or 1 percent, to $17.22.
—Lululemon, which makes high-end yoga clothing, fell after the company said its founder and chairman plans to sell a large portion of his stock. The stock lost 95 cents, or 1.5 percent, to $63.55.
—Newmont Mining was the biggest decliner in the S&P 500, hurt by a dip in gold prices. The stock lost $1.24, or 4.3 percent, to $27.78.
—Restoration Hardware, which sells high-end home products, fell after disclosing that an unnamed group of stockholders plan to sell some of its shares. The stock lost $1.28, or 1.7 percent, to $74.65.