A big rally on Wall Street suddenly vanished Tuesday, undercut in part by another plunge in the price of oil.

The S&P 500 fell 4.27 points to 2,659.41. The Dow Jones Industrial Average slipped 26.13 points, or 0.1%, to 22,653.86 after losing an earlier gain of 937 points. The Nasdaq composite dropped 25.98, or 0.3%, to 7,887.26.

The S&P 500 dipped 0.2% after erasing a surge of 3.5% earlier in the day. The market’s gains faded as the price of U.S. crude oil abruptly flipped from a gain to a steep loss of more than 9%.

It dampened what had been an ebullient day for markets worldwide, following up on Monday’s 7% surge for the S&P 500 on encouraging signs that the coronavirus pandemic may be close to leveling off in some of the hardest-hit areas of the world.

Even though economists say a punishing recession is inevitable, investors this week have recently begun to look ahead to when economies will reopen from their medically induced coma. A peak in new infections would offer some clarity about how long the recession may last and how deep it will be.

Investors could then, finally, envision the other side of the economic shutdown, after authorities forced businesses to halt in hopes of slowing the spread of the virus. In the meantime, governments around the world are talking about pumping trillions of dollars more of aid for the economy.

Many professional investors say they’ve been wary of the recent upsurge and expect more volatility ahead. The S&P 500 has rallied nearly 19% since hitting a low on March 23, though it’s still down 21.5% from its record set in February.

“It’s important to remember we shouldn’t over-extrapolate temporary trends,” said Patrick Schaffer, global investment specialist at J.P. Morgan Private Bank.

Such concerns were borne out in Tuesday's trading, when the S&P 500 swung up, down, up, down and back up again through the day.

“We are still in what you would call the relief rally off of the prior low,” said Sam Stovall, chief investment strategist at CFRA. He noted that this kind of a rally is common within deep bear markets, Wall Street-speak for when stocks decline 20% or more from a peak.

“There’s no guarantee that the worst is behind us, yet traders believe that at least there is some short-term money to be made,” Stovall said.

Earlier in the day Wall Street  opened strong as signs of progress began to emerge in the global battle against coronavirus.

The rise at the opening bell piled on even more big gains following their huge rally a day earlier, as the mood of investors seems to be improving with death tolls leveling off in hard-hit regions and stimulus measures going into effect to limit the burgeoning economic toll.

The Dow Jones Industrial Average was up 759.27 or 3.35% to 23,439.26.

The NASDAQ composite index was up 167.10 or 2.11% to 8,082.89.

The S&P 500 was up 69.62 or 2.61% to 2,732.61.

The Dow jumped as high as 900 points in early trading, according to The Hill.

Global stock markets were also on the rise on hopes that the peak of the coronavirus pandemic surge may be near in some places in the United States and Europe.

Stocks closed broadly higher on Wall Street Monday, propelling major indexes up more than 7%, as traders cheered glimmers of hope that the deadliness of the coronavirus outbreak could be slowing in some of the hardest-hit areas.

Asian markets rallied after a strong day on Wall Street, with the momentum extending into European hours.

Investors have been anxiously watching for signs that the rate of new infections may be hitting its peak, which would give some clarity about how long the upcoming recession will last and how deep it will be. Without that, markets have been guessing about how long businesses will remain shut down, companies will lay off workers and flights remain canceled due to measures meant to slow the speed of the outbreak.

The stock market is looking ahead to when economies will reopen after authorities shut down businesses and travel and issued stay-at-home orders in hopes of slowing the spread of the virus.

China on Tuesday reported no new deaths from the coronarivus over the past 24 hours. It had 32 new cases, all from people who returned from overseas.

The number of new coronavirus cases was dropping in the European hotspots of Italy and Spain. The center of the U.S. outbreak, New York, also reported its number of daily deaths has been effectively flat for two days. Even though the U.S. is still bracing for a surge of deaths due to COVID-19 and New York’s governor said restrictions should stay in place to slow its spread, the encouraging signs were enough to launch the S&P 500 to its best day in nearly two weeks.

France’s CAC 40 stock index was up nearly 3.4% to 4,488, while Germany's DAX jumped 4% to 10,477. Britain’s FTSE 100 added 2.7% to 5,739.

U.S. shares were set to drift higher with Dow futures gaining 3.9% and S&P 500 futures up 3.6%.

In Asia, Japan's benchmark Nikkei 225 gained 2.0% to finish at 18,950.18 ahead of Prime Minister Shinzo Abe's announcement of a state of emergency in Tokyo and six other regions. Abe was due to also outline details of a 108 trillion yen ($1 trillion) package to support the world’s third-largest economy, including cash handouts to needy families and help for small businesses.

»MORE: Japan's PM to declare state of emergency as early as Tuesday

India's Sensex jumped 8.1%, to 29,816.45 in what analysts characterized as a technical rally.

South Korea’s Kospi gained 1.8% to 1,823.60. Hong Kong’s Hang Seng added 2.1% to 24,253.29, while the Shanghai Composite jumped nearly 2.1% to 2,820.76. But Australia’s S&P/ASX 200 lost 0.7% to 5,252.30.

The S&P 500 is still down more than 21% since its record set in February, but the losses have been slowing since Washington promised massive amounts of aid to prop up the economy.

“Since this is a public health crisis, the response has been extreme,” Morgan Stanley strategists wrote in a report. “There are literally no governors on the amount of monetary or fiscal stimulus that will be used in this fight.”

Energy markets remained volatile as traders looked for signs that Saudi Arabia and Russia may back off their price war and cut back on some of their production. Demand for oil has plummeted due to the weakening economy, and any cutback in production would help prop up its price. A meeting between OPEC, Russia and other producers initially planned for Monday was pushed back to Thursday.

Benchmark U.S. crude added 82 cents to $26.90 per barrel. It fell $2.26, or 8%, to settle at $26.08 a barrel Monday after surging nearly $7 last week. It started the year above $60 per barrel. Brent crude, the international standard, rose 82 cents to $33.87 a barrel.

The dollar fell to 109.09 yen from 109.24 yen Monday. The euro rose to $1.0880 from $1.0792.

— ArLuther Lee contributed to this report for The Atlanta Journal-Constitution.