Two stock market indexes surged to all-time highs Thursday after Federal Reserve Chairman Ben Bernanke said the central bank will keep supporting the economy.

The Dow Jones industrial average and Standard & Poor’s 500 set records, while the yield on the 10-year Treasury note continued to decline as investors bought bonds.

Stocks that benefit most from a continuation of low interest rates, such as homebuilders, notched some of the biggest gains.

The chairman made the comments in a speech late Wednesday after U.S. markets had closed, saying the economy needs the Fed’s easy-money policy “for the foreseeable future.”

The U.S. economy needs help because unemployment is high, Bernanke said. His remarks seemed to ease investors’ fears that the central bank will pull back on its economic stimulus too quickly. The Fed is currently buying $85 billion a month in bonds to keep interest rates low and to encourage spending and hiring.

Stock index futures rose overnight. Stocks surged when the market opened Thursday and stayed high for the rest of the day.

“The Fed has made it unequivocally clear that they are not in any hurry to do anything,” said Alec Young, global equity strategist at S&P Capital IQ. “It’s very bullish for stocks.”

The S&P 500 index jumped 22.40 points, or, 1.4 percent, to 1,675.02, surpassing its previous record close of 1,669 from May 21. The index rose for a sixth straight day, its longest streak in four months.

The Dow rose 169.26 points, or 1.1 percent, to 15,460.92, above its own all-time closing high of 15,409 set May 28.

The Nasdaq composite rose 57.55 points, or 1.4 percent, to 3,578.30, its highest level in nearly 13 years.

In government bond trading, the yield on the 10-year note fell to 2.57 percent from 2.63 percent Wednesday. The yield was as high as 2.74 percent Friday after the government reported strong hiring in June. Many traders took that report as a signal that the Fed would be more likely to slow its bond purchases sooner rather than later.

The Fed has also said it plans to keep short-term rates at record lows, at least until unemployment falls to 6.5 percent. Bernanke emphasized Wednesday that the level of unemployment is a threshold, not a trigger. The central bank might decide to keep its benchmark short-term rate near zero even after unemployment falls that low.

“It’s back to the old accommodative Fed, so the markets are happy again,” said Randy Frederick, managing director of active trading and derivatives at the Schwab Center for Financial Research.

The market pulled back last month after Bernanke laid out a timetable for the Fed to wind down its bond-buying program. He said the central bank would likely ease back on its monthly purchases if the economy strengthened sufficiently.

Homebuilders, which are sensitive to the outlook for interest rates, were among the top gainers.

D.R. Horton rose $1.93, or 9.2 percent, to $22.98 and Lennar Group climbed $2.88, or 8.3 percent, to $37.44.

The housing market has benefited from low interest rates because they help make mortgages cheaper.

“The Bernanke qualifications have taken the interest rate risk off the table and now it’s really about what will earnings say,” said Jonathan Lewis, chief investment officer at Samson Capital Advisors.

Corporations began reporting earnings this week for the second quarter, which ended 11 days ago. S&P Capital IQ forecast that companies in the S&P 500 will report average earnings growth of 3 percent compared with the second quarter last year.

The price of gold gained for a fourth straight day, climbing $32.50, or 2.6 percent, to $1,279.90 an ounce. Gold has rebounded this week after falling close to a three-year low.

Gold is rising because the prospect of continued stimulus from the Fed could weaken the dollar and increase the risk of inflation. That, in turn, increases the appeal of gold as an alternative investment.