The Dow Jones Industrial Average gained 46.24 points (0.37 percent) to stand at 12,493.12 in closing trade.
The broader S&P 500 rose 4.17 points (0.32 percent) to 1,317.81, while the tech-heavy Nasdaq Composite climbed 15.01 points (0.54 percent) to 2,796.92.
Stocks got an early boost after Beijing reported that China's gross domestic product (GDP) grew 9.5 percent in the second quarter, slower than in the first quarter, but still beating analysts' expectations.
Bernanke fuelled the bullish sentiment on Wall Street when he told the US Congress that the Fed was prepared to renew its stimulus efforts if the country's economy remained feeble.
The three major stock market indices added more than one percent before paring their gains in late-afternoon trading.
Copyright AFP (Agence France-Presse), 2011