Bernanke, in testimony before the Senate Banking Committee, strongly defended the Fed's bond-buying stimulus program and quieted rumblings that the central bank may pull back from its stimulative policy measures, which were sparked by the release of the Fed minutes last week.
Bernanke's testimony helped ease concerns about a stalemate in Italy after a general election failed to give any party a parliamentary majority, posing the threat of prolonged instability and financial crisis in Europe, and sending the S&P 500 to its worst decline since early November in the previous sessions.
Bernanke "certainly said everything the market needed to feel in order to get comfortable again," said Peter Kenny, managing director at Knight Capital in Jersey City, New Jersey.
"The fear is we were going to see a rollover, and the first shot over the bow was what we saw out of Italy yesterday with the elections," Kenny said. "When it came to U.S. markets, we saw some of that bleeding stop because our focus shifted from the Italian political circus to Ben Bernanke."
Gains in homebuilders and other consumer stocks, following strong economic data, lifted the S&P 500 and a 5.6 percent jump in Home Depotto $67.38 boosted the Dow industrials. The PHLX housing sector indexrose 3.3 percent.
However, the central bank chairman also urged lawmakers to avoid sharp spending cuts set to go into effect on Friday, which he warned could combine with earlier tax increases to create a "significant headwind" for the economic recovery.
The Dow Jones industrial averageclimbed 109.04 points, or 0.79 percent, to 13,893.21. The Standard & Poor's 500 Indexgained 8.96 points, or 0.60 percent, to 1,496.81. The Nasdaq Composite Indexadvanced 13.46 points, or 0.43 percent, to 3,129.71.
Despite the bounce, the S&P 500 also failed to move above 1,500, a closely watched level that was technical support until recently, but it could now become a hurdle.
The uncertainty caused by the Italian elections continues to weigh on stocks in Europe. The FTSEurofirst-300 index of top European sharesclosed down 1.4 percent. The benchmark Italian indextumbled 4.9 percent.
Home Depotgave the biggest boost to the Dow and provided one of the biggest lifts to the S&P 500 after the world's largest home improvement chain reported adjusted earnings and sales that beat expectations. The stock climbed 5.6 percent to $67.47.
Macy'sshares gained 3.6 percent to $39.90 after the department-store chain stated it expects full-year earnings to be above analysts' forecasts because of strong holiday sales.
Economic reports that showed strength in housing and consumer confidence also supported stocks. U.S. home prices rose more than expected in December, according to the S&P/Case-Shiller index. Consumer confidence rebounded in February, jumping more than expected, and new-home sales rose to their highest in 4-1/2 years.
(Reporting by Chuck Mikolajczak; Editing by Jan Paschal)