U.S. markets wrapped up one of their messiest-ever weeks Friday, recording their worst finish since the 2008 financial crisis. The Standard & Poor’s 500 tumbled 15 percent from where it began Monday, with stocks wrenched all week in hourly spasms as investors tried to fathom where the coronavirus will eventually leave the U.S. economy.

The craziness ran right up to the closing bell, with the S&P and the Dow Jones industrial average plunging more than 3 percent minutes after the World Health Organization warned that global health systems were “collapsing” under the strain of the pandemic.

Wall Street’s meltdown over the past month has erased all of the stock market gains since President Trump entered the White House. On Feb. 12, the Dow peaked at 29,551.42 — a 49 percent jump from its close on Trump’s Inauguration Day in January 2017. But within a span of weeks it has lost a third of its value as the coronavirus crisis has played out. On Friday, it lost an additional 913.21 points, roughly 4.6 percent, to close at 19,173.98.

The S&P finished at 2,304.92, down 4.3 percent, while the tech-heavy Nasdaq composite slid 3.8 percent to close at 6,879.52.

Investors remain in the same fog they have inhabited since markets began their swift drop in February, after the S&P 500 and Dow hit all-time highs. All three indexes are now in a bear-market decline of at least 20 percent from their highs. The Dow and S&P have erased more than 30 percent in a month.

“We had years of low volatility and rising markets, and this virus crisis made it all come to an end at once,” said Kathy Jones, chief fixed-income strategist at the Schwab Center for Financial Research. “There is no endpoint in sight, and that’s causing a degree of panic because people are saying, ‘I just need to hold some cash.’ There will be more turmoil, but we flushed out a lot of the people who were leveraged. A lot of good things are happening to restore liquidity and order to markets.”

Markets lurched all week, but nothing signified the chaos like oil prices, which dropped below $20 a barrel for part of the day Friday — a mark not seen in years. Oil prices are so low that the industry may go through a generational restructuring. Prices need to be at least in the $50-a-barrel range for companies and producing states to make a profit.

Oil prices saw their worst and best percentage changes in back-to-back days Wednesday and Thursday as a Saudi-Russian feud resets markets. The federal government said it might jump in, ordering millions of barrels of oil purchases for the nation’s Strategic Petroleum Reserve to help soak up excess supply and protect prices.

Governments and central banks have unleashed a torrent of measures to relieve the economic stranglehold of the coronavirus. But those moves have yet to calm investors and institutions that have been unloading assets from stocks to bonds to gold to meet cash obligations.

“People feel like a battered boxer, unsure of how to respond to a flurry of economic punches,” said Sam Stovall of CFRA Research. “The good news out of this bad news is the volatility looks like it is coming to a crescendo. Only two other periods in the past half-century have seen a high level of volatility. History tells us the worst may be behind us.”

The Federal Reserve rolled out eight emergency actions this week, establishing a special backstop for money-market mutual funds (typically a risk-free place for investors to store cash), slashing interest rates to zero and restarting the crisis-era bond-buying program known as “quantitative easing.”

The central bank also announced plans to buy short-term business loans known as commercial paper, ramped up “swap lines” with foreign central banks to ensure other nations have enough dollars, allowed banks to borrow money from the Fed at a 0.25 percent interest rate and announced loans for primary dealers of U.S. Treasury bonds.

Treasury Secretary Steven Mnuchin announced Friday that the administration had moved back the Internal Revenue Service tax-filing deadline from April 15 to July 15 because of the widespread disruption caused by the outbreak. Mnuchin made the announcement on Twitter, citing Trump’s directive.

Signs of progress in the war against covid-19 stoked some positive feelings on Wall Street. The U.S. dollar, which had skyrocketed as worried investors rushed to secure greenbacks, weakened against other currencies.

Investors also seemed to embrace the increasingly stringent measures being used to combat the spread of the virus. California on Thursday night ordered its 40 million residents to mostly stay at home, and Illinois on Friday announced a similar order. As of Friday afternoon, nearly 260,000 coronavirus cases had been confirmed around the globe. The World Health Organization noted that it took more than three months to reach 100,000 cases worldwide — but only 12 days to log the next 100,000.

“These massive shutdowns in California, New York and elsewhere are going to take a toll,” said Ivan Feinseth of Tigress Financial Partners. “But stocks will come back. I believe in the human spirit and resiliency of people and of markets.”