The U.S. jobs situation showed some ugliness Friday morning. The stock market loved it.

The Dow Jones industrial average soared more than 260 points on news that the U.S. economy is creating fewer jobs than expected. The Dow closed at 25,983.94, up 1 percent. The Standard & Poor’s 500-stock index and the Nasdaq composite followed suit, barreling upward as stocks were on track to finish one of their best weeks of the year.

The S&P closed at 2,873.34, also up 1 percent on the day. The Nasdaq surged 126.55 points, or 1.7 percent, as the technology-laden measure closed at 7,742.10.

“Good question,” said Michael DePalma, managing director of the investment company MacKay Shields, when asked why stocks were surging on the bad news.

But bad news can be good news in the upside-down world of Federal Reserve interest-rate manipulations and presidential interventions to keep the good times rolling. The good news for stock investors this time is that the Fed is expected to again ride to the rescue of a deteriorating economy.

“The world economy is slowing, inflation is below target, and now the slowing U.S. economy with today’s no-jobs report is the final straw to break the camel’s back for the Federal Reserve sitting on the sidelines,” said Chris Rupkey, managing director at MUFG Union Bank. “Rate cuts are coming. Bet on it.”

Job creation had been the one holdout against a slowing economy. Unemployment is still crouching at a 50-year low of 3.6 percent. But the Labor Department showed that the economy created far fewer jobs last month than experts had forecast, adding the latest piece to a string of disappointing reports that shows a 10-year boom gasping — for an interest-rate cut.

“This looks like the first shot across the bow,” DePalma said. “One of the economy’s only bright spots is finally weakening. The labor reports have been so consistently good that this is a slap across the face. It gives the Fed license to cut rates.”

The odds of a rate cut rose immediately on the news, with futures placing the chance of a Fed interest-rate cut at 79 percent. The chance of a second rate cut by September rose to 95 percent. “The market is happy because the punch bowl is still there,” DePalma said.

Because of the trade wars, Iran sanctions, presidential tweets and geopolitics, “businesses don’t know what the future holds,” DePalma said. “They may be putting decisions on hold and not hiring.”

Friday’s stock surge capped a week-long rally that followed more than a month of bad news and poor returns. The Dow and S&P each shed more than 6 percent in May, and the Nasdaq had slid a full 10 percent as of Monday. The S&P was more than halfway toward a correction a week ago, when it finished its fourth consecutive week of negative returns — its first in five years. A month ago, it was 0.007 percent from an all-time high.

Markets had been cruising — despite a global slowdown — when President Donald Trump began May with a threat to increase tariffs from 10 percent to 25 percent on $200 billion worth of Chinese goods. Then he said he would impose the new 25 percent fee on all remaining Chinese imports. The surprise move jeopardized talks between the world’s two largest economies just as they appeared headed for a deal.

Then, on May 30, Trump threatened to place a 5 percent tariff on Mexican goods coming into the United States, opening another front on the trade war and tanking the stock market further.

The technology-heavy Nasdaq, which has powered the past few years of the decade-long bull market, had its own problems as Washington politicians on both sides of the aisle began calling for the investigation and regulation of the FAANG companies: Facebook, Amazon, Apple, Netflix and Google parent Alphabet.

Fed Chair Jerome Powell resurrected markets with just a few, carefully chosen words Tuesday, when he said the central bank would act if Trump’s multi-front trade war mushroomed.

“We are closely monitoring the implications of these developments for the U.S. economic outlook, and as always we will act as appropriate to sustain the expansion,” Powell said during a speech in Chicago.

That did the trick. The Dow bounced 512 points, or 2 percent, that day, and the major indexes haven’t looked back since. The Nasdaq put its correction in the rearview mirror and surged nearly 4% by Friday.

“Investors are just listening to the Fed,” Washington investor Michael Farr said. He saw irony in Friday’s stock bump from a jobs report because the nation is already beyond what is considered full employment. The jobless rate, now 3.6 percent, is lower than the 4 percent unemployment rate that is considered ideal.

“The market is convinced that this is a weak number and the economy is slowing, and that the Fed will have to ease,” Farr said. “If the Fed mandate is full employment, they are already there.”

Investor Ken Langone of Invemed Associates said he doesn’t see a recession in the offing: Even if there were a threat and the Fed lowered rates, the benefit to the economy would be limited, because money is already so cheap.

“I don’t think the Fed has that much opportunity to influence things the way they had in the past,” said Langone, one of the co-founders of Home Depot. “It won’t stimulate demand for housing any more than you already have. Businesses that rely on cheap money will do better. Businesses that are negatively hit, like banks, will not do well.”

All but two of the 30 Dow components were up Friday, with JPMorgan Chase and Verizon slumping. Investors were happy.

“The jobs report is bad news for Main Street and good news for Wall Street,” said Jared Bernstein, who served as the economic adviser to Vice President Joe Biden. “It’s a microcosm of our inequality problem. You have wage gains that appear to have stalled, and Wall Street loves that because it means fatter profit margins.”

Bernstein said keeping the American consumer flush is just as important, if not more so, than keeping Wall Street happy.

“In an economy that is 70 percent consumer spending, if the consumer isn’t healthy, corporate profitability and the stock market won’t save us,” Bernstein said.