The better-than-expected report sends the Dow, which briefly topped 15,000 for the first time, and S&P 500 to new highs.

NEW YORK —The economy may still be dallying on its way to a recovery, but investors are paying that no mind, sending the stock market to all-time highs after a better-than-expected April jobs report.

The Dow Jones industrial average and the Standard & Poor's 500 closed at record levels Friday, and the Dow briefly topped 15,000 for the first time.

"The market was positively surprised by these job numbers," said Quincy Krosby, market strategist for Prudential Financial. "It helped assuage market fears that the recent soft patch was intensifying."

It's not that the job numbers were wonderful — employers added a modest 165,000 jobs.

But in contrast to other recent data, the figures gave investors reason to be optimistic. The economy grew just 2.5% in the first quarter, the Commerce Department said last week, and a recent report by the Institute for Supply Management showed that the pace of manufacturing growth slowed in April.

Still, the S&P closed at 1,614.22, up 1% for the day, and the blue-chip Dow closed at 14,972.19, up 0.95%. The S&P is up 12% since the beginning of the year.

"Except for the housing sector, almost all the data is showing weakness," said David Dietze, president and chief investment strategist at Point View Wealth Management in Summit, N.J. "You look at the stock market and you're left scratching your head, wondering, why are we at an all-time high given these economic numbers?"

The answer, says Dietze and other market observers, is that investors see more opportunity to make money in the U.S. stock market than just about anywhere else. And investors are fleeing from the bond market, which might be safer than stocks but has provided very little upside.

As long as they remain confident that the Federal Reserve will keep interest rates low and continue to pump money into the economy, they will keep investing. Central banks in Japan and Europe have also indicated that they are willing to keep investing money in the economy, if needed.

"You have an environment of modest growth, stable inflation, which sends a signal that the Fed is going to keep doing what it's doing," said Michael Gapen, director of U.S. economic research at Barclays. "The outlook still looks favorable for equities."