Wall Street is in the midst of a stunning three-month rally that is close to putting investors back where they were in January, before the coronavirus pandemic obliterated trillions in wealth.

A surprisingly positive jobs report on Friday helped stock markets extend an already strong week, pushing the Standard & Poor’s 500 index — which has soared 9 percent in three weeks — within 1 percent of turning positive for 2020, according to Howard Silverblatt of S&P Dow Jones Indices. The S&P was more than 30 percent in the hole less than three months ago. It jumped 81 points, or 2.6 percent, to close Friday at 3,193.93.

The Nasdaq — already ahead more than 9 percent this year — added 198 points, or nearly 2.1 percent, to settle at 9,814.08. The tech-centric index is within a hair of its all-time high. The Nasdaq 100, a collection of the largest nonfinancial Nasdaq companies, set a record high, led in part by recoveries in airline and hotel stocks.

The Dow Jones industrial average rocketed more than 1,000 points after the release of May unemployment numbers, then cut its gains to 829 points, or 3.2 percent, to end at 27,110.98 — its first close above 27,000 in three months. The advance put the blue-chip index within 5 percentage points of turning positive for the year.

The Labor Department said Friday that the nation’s jobless rate fell to 13.3 percent — a far cry from the 19.5 percent analysts had forecast and a significant improvement from the 14.7 percent recorded in April — as states incrementally reopened after months of pandemic-fueled shutdowns and some Americans were able to get back to work. More than 2.5 million jobs were created in May.

“We have been given today the surprise of our investor lives,” said Bryce Doty, senior portfolio manager at Sit Investment Associates, a Minneapolis money management firm. “The timing of the economic recovery just moved up. Markets had been telling us economic activity was picking up, and today bears that out.”

Markets thrived this week as investors loaded up on stocks from companies with the most to gain in a reopened economy: Aerospace giant Boeing boomed more than 40 percent, while Coca-Cola, Chevron, ExxonMobil, Walt Disney and Caterpillar soared on the presumption of more dining out, greater travel, increased driving and summer vacations. Apple shares hit a record high Friday, closing at $331.50, up nearly 2.9 percent. The iPhone-maker has seen its stock advance 50 percent since March.

Much of the employment gains were among sectors the pandemic hurt the most, including leisure and hospitality, education, construction and retail. The rebound may be a sign the market may have appropriately anticipated a quick revival — in part because of massive interventions by the federal government and the Federal Reserve.

“Some of the economic data already looks V-shaped,” said Liz Ann Sonders, chief investment strategist at Charles Schwab & Co. “We saw complete reversals in the industries that lost the most in the shutdown. The persistence of the strength of this recovery is the question.”

European markets closed their second consecutive day of big gains following the European Central Bank’s announcement on Thursday that it would add $676 billion (600 billion euros) to its coronavirus rescue plan, making the total package worth more than $1.5 trillion.

“The policy stimulus globally has been nothing short of breathtaking,” said David Rosenberg of Rosenberg Research.

Germany, one of Europe’s most powerful economic engines, also announced a fresh stimulus package Thursday amid rising unemployment.

“There are a number of reasons to be cautious in this market but none are clearly as compelling as the grand economic reopening and authorities everywhere pumping out cash like it’s going out of fashion,” Craig Erlam, an analyst with OANDA, wrote in commentary Friday. “This is purely a stimulus and momentum trade and it’s not running shy of either.”

Despite ongoing protests nationwide since George Floyd died in police custody last week and the U.S. grappling with its worst economic crisis since the Great Depression, investor optimism has been steadily gaining as numbers improve.

On Thursday, weekly unemployment claims came in below estimates and appear to have started leveling off — though at 1.9 million the losses are still staggering. The number of people paying off their mortgages has ticked up, marking the first net decline in active forbearance plans since the Cares Act was enacted. Personal incomes have risen 10.5 percent, thanks largely to federal stimulus checks. Home sales are on the rise, helped by record-low interest rates. Private payrolls shed 2.76 million jobs in May, ADP reported Wednesday, well below the 8.75 million forecast by economists.

Oil prices soared to their highest levels in three months ahead of this weekend’s meeting of OPEC and its allies, where the organization is expected to agree to more production cuts while the world gets back in motion. Brent crude, the international benchmark, rose 5 percent to $42 per barrel. West Texas Intermediate crude, the U.S. benchmark, climbed more than 4 percent to $39.17 per barrel.

Analysts caution that recovery could take years, given the magnitude of the economic damage. A Monday report from the Congressional Budget Office estimated that fallout from the coronavirus crisis will shrink the size of the U.S. economy by roughly $8 trillion over the next decade. That amounts to a 3 percent decline in U.S. gross domestic product compared with its initial estimate.

Sustained stock gains through June could have a big impact on the American consumer come July, when people open their quarterly retirement statements.

“There is a going be a huge change in the number between the end of the first and second quarters,” said Ivan Feinseth of Tigress Financial Partners. “When people look at their 401(k) and retirement statements, they are going to be happy. That will help drive the second half of the year.”