As the deaths and unemployment claims from the coronavirus pandemic steadily mounted, the stock market this month did something unexpected: It went up. And up. And up.

The Dow Jones industrial average has risen almost 30 percent from its March 23 low, a remarkable turnaround from the 20-day plummet that produced the fastest bear market in history. The Dow closed roughly flat on Tuesday after another big rally on Monday.

“The stock market was up very substantially today," Trump said Monday. "And people are seeing a lot of good things, a lot of very smart people investing in the stock market right now.” He promised an “incredible” economic comeback later this year.

The market’s stunning surge is less a sign that the economy is doing well — it’s obviously not — than an indication that investors anticipate such a swift recovery once the pandemic shutdown ends. The bet is that weak corporate earnings and gloomy forecasts of plunging output are outweighed by a multitrillion dollar Federal Reserve rescue effort.

“There is a seemingly unlimited safety net under the economy,” said Tony Roth, chief investment officer of Wilmington Trust. “The Fed intervention has been very effective and provided significant confidence for the equity market.”

The stock market’s performance is one of Trump’s favorite economic indicators. But stock ownership is highly concentrated: The wealthiest 10 percent of Americans own 84 percent of all stocks. The bottom 90 percent own the rest, many in 401(k) retirement accounts, according to a 2016 study by Edward Wolff, an economics professor at New York University.

Yet rarely have Wall Street’s fortunes seemed so divorced from Main Street’s reality.

Even as the stock market soared this month, businesses across the country faced collapsing sales, painful layoffs and profound uncertainty about when life would return to normal.

Investors credit the Fed with saving the markets from collapse and preventing a new financial crisis from making the recession worse. As trading seized up amid the initial March panic, the central bank swiftly launched plans to buy massive quantities of government, corporate and municipal bonds.

But even as it did, companies across the country closed in response to government edicts, sending more than 26 million Americans into the unemployment line. The jobless rate is heading toward its highest level since the Great Depression’s 25 percent, a reminder that the central bank’s tools are better suited to healing the financial market than the labor market.

“The bulk of the job losses are coming from the one part of the economy with few linkages to markets,” said Ajay Rajadhyaksha, head of macro research for Barclays. “Small and medium-sized businesses are much harder to help through the financial markets, and they’ve seen their cash flows vanish overnight.”

Indeed, the businesses that are the most visible parts of local economies — restaurants, dry cleaners, machine shops — typically do not raise money by selling bonds or short-term notes known as commercial paper to investors.

The Fed is launching a program to lend directly to Main Street businesses that fall in the crack between financial markets and existing small-business programs. But the unusual effort is only getting started.

The Trump administration launched an unprecedented small-business loan program designed to prevent companies from laying off their workers, part of nearly $3 trillion Congress approved to counter the pandemic’s medical and economic toll.

But that program has not worked as smoothly as the Fed’s many market interventions. Amid numerous administrative headaches — and heavily criticized loan disbursements to affluent operations such as the Los Angeles Lakers and Shake Shack — the troubled Paycheck Protection Program has been slow to deliver money to its intended beneficiaries. With renewed funding, it began accepting applications again Monday.

The program’s continuing struggles come as Americans brace for the most punishing economic downdraft since the 1930s. The economy probably contracted at an annual rate of -4.5 percent in the first quarter, its worst reading since the end of 2008, according to Jim O’Sullivan, chief U.S. macro strategist for TD Securities.

That annualized decline could accelerate to -35 percent through the end of June — a horrific pace that appears worse than the reality since it assumes the three-month plunge continues for the entire year.

The bulls’ case is that the worst will soon be over and the Dow, now about 18 percent below its February all-time record, will reach new heights.

In this view, the pandemic, though tragic and costly, is akin to a natural disaster. Unlike during the global financial crisis in 2008-09, the economy was healthy before the pandemic interrupted its progress. Once the storm passes, workers can return to their jobs and companies can resume growing.

“This is a one-quarter event, not a multi-quarter or multiyear event,” said Lori Heinel, deputy global chief investment officer for State Street Global Advisors. “We’ll see a very sharp rebound in the second half that will set up the market to go higher.”

Heinel acknowledged that parts of the economy — such as the travel and hospitality industries — will remain depressed for some time. Activity may not return to precrisis levels until a coronavirus vaccine becomes widely available.

But those sectors are not that large compared with finance and technology, which should continue to grow. The market could reach a new all-time high by the end of next year, she said.

The market’s month-long rebound assumes the sort of V-shaped recovery the president has often touted. But the rally looks “fragile” to Liz Young, director of market strategy for BNY Mellon Investment Management.

“A lot of things have to fall into place for that to occur,” she said. “And the chance that all of them happen and nothing goes wrong is pretty low.”

The stock market’s rebound from its coronavirus crash faces a test this week as companies such as Caterpillar, 3M, Ford and Apple release their first-quarter earnings. And the Commerce Department is expected to report on Wednesday that the U.S. economy turned in its worst performance in a decade during the first three months of the year, thanks to the coronavirus.

Investors also will be watching the Federal Reserve, as its rate-setting committee is scheduled to begin a two-day meeting Tuesday and Fed Chair Jerome H. Powell briefs reporters via video link on Wednesday.

Hopes for a smooth recovery may be disappointed if the first states to reopen for business stumble or a second wave of infections materializes this fall. First-quarter earnings released so far have been “dismal,” Goldman Sachs said on Monday.

“We are mild bears here,” said Rajadhyaksha. “We think stocks have gone up way too much, way too quickly.”

The last month’s market rebound also rests on a distressingly narrow foundation, which in the past has signaled trouble ahead.

The five largest stocks — Microsoft, Apple, Amazon, Facebook and Alphabet — now account for 20 percent of the value of the Standard & Poor’s 500 index, topping the March 2000 high set at the peak of the high-tech bubble, according to Goldman.

A large number of S&P 500 stocks are trading far below their February peak, lagging the overall index by a bigger amount than usual. Such characteristics in the past have been read as a warning of below-average returns.

As more states allow businesses to reopen, household and corporate debt is likely to weigh on the recovery by depressing spending on new factories and equipment as well as cars and clothing, according to Richard Bernstein, chief executive of an eponymous New York investment firm.

Companies starved for revenue and workers missing their paychecks will be hard-pressed to pay off what they borrowed during the record economic expansion that ended in March.

“We are crushing household and corporate cash flow,” he said.

After a decade-long borrowing binge, many companies now face higher interest charges as they try to roll over their debts. Companies with the best credit ratings now must pay bondholders about 2.4 percentage points above the U.S. Treasury yield, up from roughly 1 percentage point in late February.

More than 21 percent of consumers surveyed in the final week of March said they expect to miss a debt payment over the next three months, according to the Federal Reserve Bank of New York.

“Right now, you’ve got a very momentum-oriented market with a lot of fear-of-missing-out,” Bernstein said. “We might even see a new high, but that doesn’t mean we’re out of the woods.”