NEW YORK (AP) — A big rally on Wall Street is losing steam in afternoon trading Tuesday, undercut in part by another plunge in the price of oil.

The S&P 500 had been up as much as 3.5% early in the day, tacking more gains onto its 7% surge Monday following encouraging signs that the coronavirus pandemic may be close to leveling off in some of the hardest hit areas of the world.

But the gains mostly evaporated in the afternoon after the price of U.S. crude oil slid more than 7%. Energy stocks in the S&P 500 were clinging onto a 2.9% gain after earlier being up nearly 8%.

That weighed on the overall market, and the S&P 500 was up just 0.7%, as of 2:52 p.m. Eastern time.

Earlier in the day, Wall Street had surged to big gains as markets around the world rallied for a second straight day following 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, the stock market is looking ahead to when economies will reopen from their medically induced coma. A peak in new infections would offer some clarity about 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 approving or discussing trillions of dollars more of aid for the economy.

Many professional investors say they’re wary of the recent upsurge and expect more volatility ahead. But if Tuesday’s slight gains hold, it would be one of the few times the market has mustered a back-to-back gain since the coronavirus outbreak caused it to start selling off in mid-February.

“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.

The Dow Jones Industrial Average was up 148 points, or 0.7%, to 23,828, and the Nasdaq was up 0.1%.

Oil prices have been even more volatile than the stock market in recent weeks as demand dries up for energy amid a global economy weakened by the coronavirus outbreak. Russia and Saudi Arabia have also been locked in a price war, refusing to cut production even as the world is awash in excess oil.

READ MORE: Trump says he expects Russia and Saudi Arabia to cut oil production

Benchmark U.S. crude oil fell $1.98 to $24.11 per barrel.

In China, the first country to lock down wide swaths of its economy to slow the spread of the virus, authorities reported no new deaths over the past 24 hours. Many experts, though, are skeptical of China’s virus figures.

Investors also see signals that the number of daily infections and deaths may be close to peaking or plateauing in Spain, Italy and New York. The number of daily deaths rose in New York, the center of the U.S. outbreak, but other statistics were more encouraging, including the average number of people hospitalized each day.

Experts say more deaths are on the way due to COVID-19, which has already claimed at least 76,000 lives around the world. The U.S. leads the world in confirmed cases with more than 369,000, according to a tally by Johns Hopkins University.

More economic misery is also on the horizon. Economists expect a report on Thursday to show that 5 million Americans applied for unemployment benefits last week as layoffs sweep the country. That would bring the total to nearly 15 million over the past three weeks. Analysts also expect big companies in upcoming weeks to report their worst quarter of profit declines in more than a decade.

WATCH: Economist Ken Rogoff on whether the U.S. has ever experienced a crisis like this one

Massive aid from the Federal Reserve has helped smooth out snarled trading that had beset lending markets earlier in the sell-off. Companies are coming back to the bond market to borrow, even some with “junk” credit ratings, and investors are actually lending them money again.

Japan’s government on Tuesday formally announced a 108 trillion yen ($1 trillion) package for the world’s third-largest economy.

In the U.S., the world’s largest economy, House Speaker Nancy Pelosi is telling her colleagues that another $1 trillion is needed for the next coronavirus rescue package. Last month, Congress approved a $2.2 trillion package.

Senate Majority Leader Mitch McConnell said that he’s pushing for the Senate to vote as early as Thursday to give additional funding to a small-business program that’s part of the rescue package.

In Europe, Germany’s DAX jumped 2.8%, and France’s CAC 40 rose 2.1%. The FTSE 100 in London added 2.2%.

In Asia, Japan’s Nikkei 225 rose 2%, South Korea’s Kospi gained 1.8% and the Hang Seng in Hong Kong was up 2.1%.

In a signal that investors are feeling less pessimistic about the economy and inflation, they pushed the yield of the 10-year Treasury up to 0.73% from 0.67% late Monday.

That’s still painfully low relative to history. The yield was above 1.90% earlier this year and had never been below 1% until last month. Nonetheless, it’s been climbing since it hit a record low of 0.498% in early March, according to Tradeweb.

Despite yields remaining near all-time lows, there is an encouraging sign in bond markets: longer-term Treasury yields are still higher than short-term ones. That’s a reversal from the “inverted yield curve” of earlier this year, a warning sign for investors that occurs when short-term yields are higher than long-term ones.