Retailers were among the best performers on Wednesday, with the SPDR S&P Retail ETF (XRT) jumping 4.7 percent. Shares of Wayfair, Kohl's and Dollar General all rose more than 7 percent. Data released by Mastercard SpendingPulse showed retailers were having their best holiday season in six years . Amazon's stock also jumped 9.45 percent, snapping a four-day losing streak, after the company said it sold a record number of items this holiday season.

The also catapulted 4.96 percent — its best day since March 2009 — to 2,467.70 as the consumer discretionary, energy and tech sectors all climbed more than 6 percent. The Nasdaq Composite also had its best day since March 23, 2009, surging 5.84 percent to 6,554.36.

The 30-stock Dow closed 1,086.25 points higher, or 4.98 percent, at 22,878.45. Wednesday's gain also marked the biggest upside move on a percentage basis since March 23, 2009, when it rose 5.8 percentage points.

Stocks posted their best day in nearly a decade on Wednesday, with the Dow Jones Industrial Average notching its largest one-day point gain in history. Rallies in retail and energy shares led the gains, as Wall Street recovered the steep losses suffered in the previous session.

Energy stocks also jumped as U.S. crude oil prices catapulted more than 8 percent. Shares of Marathon Oil and Hess were the best performers within the energy sector, jumping 11.9 percent and 11 percent, respectively.

John Augustine, chief investment officer at Huntington Private Bank, said he welcomed Wednesday's rally but added: "We still have a ways to go. We need to have three days of moving higher into the close to stem this wave of selling."

A strong sell-off on Monday sent the major indexes down more than 2 percent and ended with the S&P 500 falling into a bear market. Monday's pullback was also the worst Christmas Eve decline ever. The S&P 500 was down 20.06 percent from an intraday record high set on Sept. 21 before Wednesday's sharp rebound. U.S. exchanges were closed Tuesday for the Christmas holiday.

The recent decline in stocks "is a buyer's strike due to lack of confidence in policymakers around the world," said Augustine. "It's going to take a long time to recover that confidence."

The plunge in stocks on Monday came after Treasury Secretary Steven Mnuchin held calls with CEOs of major U.S. banks last weekend and issued a statement saying, "The banks all confirmed ample liquidity is available for lending to consumer and business markets."

Monday's move lower also came after President Donald Trump commented on the Federal Reserve once more, calling it "the only problem our economy has" in a tweet. Trump also said Tuesday the Fed was "raising interest rates too fast because they think the economy is so good." Trump has been critical of the Fed's decisions regarding monetary policy this year. The central bank has hiked overnight rates four times this year.

"With the end of the quarter, we could get a bounce in the next few days," said Peter Cardillo, chief market economist at Spartan Capital Securities. But "the problem is [President Donald] Trump continues to create a lot of uncertainty. We can't focus on the fact there are a lot of good bargains out there."

This is all taking place amid an ongoing government shutdown that started last week. The Trump administration and congressional leaders are at a stalemate over funding for a wall along the U.S.-Mexico border. The administration says the wall is important for national security while opponents of the barrier note it will not solve the U.S.' immigration issues.

"Government shutdown starts with no end game strategy by either side," L. Thomas Block, Washington policy strategist at Fundstrat Global Advisors, said in a note to clients. "The President ... remains convinced that fighting for HIS wall is worth a government shutdown and his base loves the confrontation."

—CNBC's Robert Hum, John Melloy and Michael Sheetz contributed to this report.