Led by Silicon Valley stalwarts Apple, Amazon and Google, the surge put the brakes on a six-day losing streak that saw the S&P 500 surrender 11 percent.
In a sign that a faltering Chinese economy and slumping global financial markets could affect U.S. monetary policy, New York Fed President William Dudley said the prospect of a September rate hike seemed "less compelling" than it was just weeks ago.
All 10 major S&P 500 sectors jumped, led by a dizzying 5.3 percent jump in the technology index .SPLRCT, its largest one-day rise since 2009.
Some of the late-day rally was driven by short-term traders, including many who had bet the market would fall and rushed to cut their losses, said Michael Matousek, head trader at U.S. Global Investors Inc in San Antonio.
A strong rally on Tuesday had evaporated in the final minutes of trading and turned negative.
“A lot of people were anticipating the last half of the day would roll over and fall off and that hasn't happened," Matousek said. "You could see the buying accelerating at mid-day and people saying 'I'm wrong', and starting to cover their shorts.”
The Dow Jones industrial average .DJI finished 3.95 percent higher at 16,285.51. Its gain of 619.07 points was its biggest since 2008.
The S&P 500 .SPX gained 3.9 percent to 1,940.51 and the Nasdaq Composite .IXIC added 4.24 percent to end at 4,697.54.
Dudley's dovish comments came even after data on Wednesday that appeared to strengthen the case for a rise in interest rates at a Fed policy meeting on Sept 16-17.
Durable goods orders rose 2 percent in July, compared with analysts' average forecast of a 4 percent fall. Orders for core capital goods, a proxy for business investment, rose 2.2 percent in the biggest gain in 13 months.
Shares in Apple (AAPL.O), which had taken a beating in recent weeks because of concern about demand in China for iPhones, provided the biggest boost to the S&P 500 and Nasdaq composite index, jumping 5.73 percent to $109.69.
Up to Tuesday's close, the Dow had lost 10.71 percent in the past six trading days and the Nasdaq composite .IXIC had shed 11.5 percent.
The S&P is now down 5.8 percent in 2015.
“We're still in a period of searching,” said Kurt Brunner, a portfolio manager at Swarthmore Group in Philadelphia, Pennsylvania. “You have more people taking advantage of upside. But we're in for some sloppy trading and I don't think it's over today. I don't think it's a straight shot up."
The recent pummeling in U.S. shares reduced valuations some investors had seen as pricey. The S&P 500's valuation was down to about 14.8 times expected earnings as of Tuesday's close, compared to around 17 for much of 2015 and below a 15-year average of 15.7, according to Thomson Reuters StarMine data, the most recent available.
Google (GOOGL.O) surged 7.72 percent after Goldman Sachs raised its rating to "buy" from "neutral". Amazon (AMZN.O) jumped 7.38 percent.
After the bell, Apple supplier Avago Technologies (AVGO.O) posted fiscal third-quarter earnings per share that beat analysts' expectations and its shares rose 2 percent.
During Wednesday's session, NYSE advancing issues outnumbered decliners 2,474 to 646. On the Nasdaq, 2,136 issues rose and 713 fell.
Underscoring the market's frailty, the S&P 500 index showed no new 52-week highs and 28 new lows, while the Nasdaq recorded five new highs and 142 new lows.
Volume was heavy, with about 10.5 billion shares traded on U.S. exchanges, far above the 7.6 billion average this month, according to BATS Global Markets.