The U.S. stock market is a day away from having its best month since 1974.

The optimism helped the S&P 500 jump 2.66 percent higher, and it extended a rally that’s brought the U.S. stock market to the brink of its best month in 45 years. The S&P 500 has surged more than 12 percent in April, putting it within one day of its best month since its 16.3 percent gain in October 1974.

Over the past 12 months, the S&P is down 2.6 percent.

The Dow Jones Industrial Average rose 2.2 percent. The Nasdaq Composite climbed 3.57 percent. The small-cap Russell 2000 soared 4.83 percent.

Stocks in Europe also jumped immediately after Gilead Sciences said its experimental drug proved effective against the new coronavirus in a major U.S. government study. The French CAC 40 rose 2.2 percent after being down before the Gilead report. The German DAX returned 2.9 percent, and the FTSE 100 in London added 2.6 percent.

Gilead’s report hit markets at the same moment that a report showed how pervasive and painful the hit has been to the economy from the coronavirus outbreak. The U.S. economy shrank at a 4.8 percent annual rate in the first three months of the year, its worst performance since the depths of the financial crisis in 2008.

The figure was worse than investors were expecting, and it’s “merely the tip of the iceberg,” said Michael Reynolds, investment strategy officer at Glenmede. Job losses have exploded since early April, as layoffs sweep the nation following widespread stay-at-home orders, and economists expect to see even worse numbers for the second quarter of the year.

But stocks have been rallying over the last month as investors look beyond the current economic devastation and focus instead on the prospect of economies gradually reopening.

Stocks initially moved higher afternoon trading after the Federal Reserve issued a statement saying it plans to keep its key interest rate near zero for the foreseeable future but quickly gave up those additional gains. The central bank also reaffirmed its commitment to using its full range of tools to support the U.S. economy through its near-paralysis caused by efforts to stem the spread of the outbreak.

Some U.S. states and nations around the world have laid out plans to relax restrictions keeping people at home and businesses bereft of customers. A drug treatment for COVID-19, meanwhile, could help life inch a little closer to “normal.” Dr. Anthony Fauci, the nation’s top infectious diseases expert, called the results on Gilead’s remdesivir drug optimistic and said details will be submitted to a scientific journal. COVID-19 has killed more than 218,000 worldwide.

But what got the nearly 32 percent rally for the S&P 500 started on March 24 was massive aid from the Federal Reserve and Congress. Investors will be watching closely during an afternoon news conference by Fed Chairman Jerome Powell for clues about how long the Fed will keep in place its unprecedented efforts to prop up the economy.

Small stocks got punished much more than the rest of the market when recession worries were at their height due to their more limited financial resources. But they can soar higher when pessimism is receding.

The market’s gains were widespread and accelerated through the day. Big tech and communications stocks helped lead the way after Google’s parent company said its revenue was stronger in the first three months of the year than Wall Street was expecting.

In Asia, Hong Kong’s Hang Seng added 0.3 percent, and the Kospi in Seoul advanced 0.7 percent.

Many professional investors are skeptical of the U.S. stock market’s big rally. There’s still a lot of uncertainty about how long the recession will last.

The vigorous rise for stocks over the last month also implies investors see a relatively quick rebound for the economy and profits following the current devastation. But it may take a while for households and businesses to get back to how things used to be.

Fed chair Powell said Wednesday that the “chances are” the economy would not rebound very quickly because people will be reluctant to return to their pre-pandemic activities until they are confident that the virus is fully under control.

The yield on the 10-year U.S. Treasury rose to 0.624 percent from 0.61 percent late Tuesday. Yields tend to rise when investors think the economy will be stronger than earlier expected or that inflation will be higher.

Oil prices are continuing their extreme swings after a collapse in demand has sent crude storage tanks close to their limits. Benchmark U.S. oil rose 23.6 percent to $15.26 per barrel. Brent crude, the international standard, rose 12 percent to $22.93 per barrel.

___

–The Associated Press and AP Business Writer Joe McDonald contributed to this report.