NEW YORK (Reuters) - U.S. stocks deepened their selloff on Wednesday and the Dow erased virtually the last of its gains since President Donald Trump’s 2017 inauguration, as the widening repercussions of the coronavirus pandemic threatened to cripple economic activity.

The benchmark S&P 500 index ended down 5.2%, though it pared losses late in the day as the U.S. Senate passed legislation to provide billions of dollars to limit the damage from the outbreak through free coronavirus testing, paid sick leave and expanded safety-net spending.

In a move likely to add to the anxiety, the Intercontinental Exchange Inc ICE.N, owner of the New York Stock Exchange, said after the bell that the NYSE will temporarily close its trading floors and move fully to electronic trading beginning Monday.

The NYSE said a floor trader and an NYSE employee had tested positive for the coronavirus, but that they had not entered the stock exchange building. Trading and regulatory oversight of all NYSE-listed securities will continue without interruption, the exchange said.

With airports and hotels emptying and airlines asking staff to take unpaid leave to stem losses, the S&P 1500 airlines index .SPCOMAIR sank 20.8% on Wednesday. Shares in major hotel operators Hilton HLT.N, Marriott MAR.O and Hyatt H.N fell by about 12% to 19%.

“The market’s really reacting to fear and uncertainty and we don’t think it’s over until it finds a floor on stock prices. The floor will have to be found in containment of the viral spread and limiting the economic toll of the virus,” said Nela Richardson, investment strategist at Edward Jones.

By Wednesday’s close, the Dow was up just 0.4% from where it was on Jan. 20, 2017, the day of Trump’s inauguration, although it remains up almost 9% from when Trump unexpectedly won the presidential election on Nov. 8, 2016, often referred to as the “Trump Bump.”

The S&P 500 is now down about 29% from the record closing high it notched on Feb. 19, as the coronavirus-inspired selloff ended Wall Street’s longest-ever bull run.

In one of the most dire forecasts yet issued for the potential hit from the epidemic, a JP Morgan economist said the U.S. economy could shrink 4% this quarter and 14% next quarter, and for the year it is likely to shrink 1.5%.

The Dow Jones Industrial Average .DJI fell 1,338.46 points, or 6.3%, to 19,898.92, the S&P 500 .SPX lost 131.09 points, or 5.18%, to 2,398.1, and the Nasdaq Composite .IXIC dropped 344.94 points, or 4.7%, to 6,989.84.

The dramatic stimulus measures have only provided short-lived bounces in equities, with investors factoring in a global recession and worrying about the duration of the damage extending into the summer.

Wednesday's selling at one point triggered another 15-minute trading cutout at a 7% decline in yet another day of volatile trading. The Cboe Volatility index .VIX ended up at 76.45.

“This market went from a position of where we were fearless back at the beginning of February to some days like today where you feel hopeless about what’s going on in the market,” said Wayne Wicker, chief investment officer of Vantagepoint Investment Advisers.

Slideshow ( 14 images )

The day's worst-performing S&P sector was the S&P 500 energy sector .SPNY, which closed at its lowest level since early 2003. U.S. crude futures fell nearly 17% on Wednesday, having touched their lowest prices in 18 years.

Worries about mass debt defaults or writedowns pressured U.S. lenders, sending the S&P 500 banking subsector .SPXBK down 7.9%.

Shares in plane maker Boeing Co BA.N, long a symbol of U.S. tech and industrial power, sank another 17.9%.

Slideshow ( 14 images )

Declining issues outnumbered advancing ones on the NYSE by a 12.71-to-1 ratio; on Nasdaq, a 8.79-to-1 ratio favored decliners.

The S&P 500 posted five new 52-week highs and 294 new lows; the Nasdaq Composite recorded 11 new highs and 1,214 new lows.

Volume on U.S. exchanges was 18.51 billion shares, compared to the 14.6 billion average for the full session over the last 20 trading days.