By JeeYeon Park, CNBC.com
Stocks slipped slightly from session highs but still closed broadly higher Tuesday, led by gains in the energy sector, following a handful of economic news that helped boost market confidence.
The Dow Jones Industrial Average gained 123.14 points, or 1.03 percent, to finish at 12,076.11.
The S&P 500 rose 16.04 points, or 1.26 percent, to close at 1287.87, while the tech-heavy Nasdaq climbed 39.03 points, or 1.48 percent, to 2,678.72. The CBOE Volatility Index, widely considered the best gauge of fear in the market, tumbled more than 6 percent to trade around 18.
The Dow and Nasdaq are seeing their best gains since Apr. 20, while the S&P is having its best day since Mar. 21.
All key S&P sectors were in the green, led by growth plays energy, industrials and materials.
Bernanke warned that a failure to lift the government's debt ceiling risks a loss of confidence in America's creditworthiness, saying the U.S. could lose its AAA credit rating and the greenback's status as the reserve currency could be damaged.
"Even a short suspension of payments on principal or interest on the Treasury's debt obligations could cause severe disruptions in financial markets and the payments system," Bernanke said at an event sponsored by the Committee for a Responsible Federal Budget.
On the tech front, Google advanced after the search-engine giant unveiled new features to accelerate search results and simplify the process for smartphone users.
Most big financials pared earlier gains, including BofA and Citigroup.
GT Solar climbed after the firm boosted its profit and revenue outlook. Other solar stocks were also higher following the news.
Among the day's economic news, retail sales fell for the first time in 11 months, although the decline was less than expected. Total retail sales slipped 0.2 percent, the Commerce Department reported. Economists expected a decline of 0.4 percent, according to Reuters.
JCPenney soared almost 20 percent to lead the S&P 500 after the clothing retailer named former Apple's head of retail operations Ron Johnson as the new CEO.
Meanwhile, the Producer Price Index increased 0.2 percent in May, according to the Labor Department. Excluding the volatile food and energy categories, the core index also increased 0.2 percent.
Stocks initially soared following news the Chinese central bank raised reserve ratios requirement for banks for the ninth time since last October after data showed inflation rising to its highest level in almost three years.
The report helped boost metals prices, lifting mining and industrial stocks such as Freeport McMoran and Caterpillar.
Analysts said the news suggested a measured slowdown of the Chinese economy and this encouraged investors to go into risky assets. But economist Nouriel Roubini said China is facing a "meaningful probability" of a hard landing.
On the IPO front, Internet radio company Pandora is scheduled to begin trading Wednesday under the symbol "P." The firm is slated to offer 14.7 million shares for $10 to $12 a share. The company increased the size of its IPO last week by 43 percent in the face of high demand.
Also on the economic front, business inventories rose 0.8 percent April, the highest since October 2008, the Commerce Department reported. Economists expected a rise of 0.9 percent, according to Reuters.
European shares closed sharply higher following the positive economic report out of China.