Stocks rose for a fourth session on Thursday following encouraging comments by European Central Bank President Mario Draghi on tools to tackle the region's debt crisis and in support of the euro.

Financial shares led the market higher after Draghi said the ECB was ready to buy the bonds of euro zone member countries that ask for it, leaving the door open to a widely expected bailout of Spain.

"Draghi has not disappointed the markets today," said Peter Cardillo, chief market economist at Rockwell Global Capital in New York.

"The dollar is weak and we see risk coming back into the market," said Cardillo, referring to Draghi's comment that the euro is "irreversible" in an affirmation of his commitment to the currency and the region's monetary system.

Speaking at a regular monthly news conference, Draghi also said "significant progress" had been made in Spain to bring order to its finances, although more was needed.

Also supporting stocks, data showed that fewer Americans than expected had filed new claims for unemployment benefits last week, suggesting a mild improvement in the labor market. A separate report showed factory orders fell slightly less than expected.

The Dow Jones industrial average gained 96.13 points, or 0.71 percent, to 13,590.74. The S&P 500 rose 11.44 points, or 0.79 percent, to 1,462.43. The Nasdaq Composite added 13.01 points, or 0.42 percent, to 3,148.24.

The weaker dollar helped lift prices of crude oil and basic metals, boosting shares in the energy and materials sectors.

Hewlett-Packard shares fell 4.2 percent to $14.30, adding to Wednesday's 13 percent slide after Chief Executive Meg Whitman warned of an unexpectedly steep earnings slide in 2013.

The Federal Reserve releases minutes from the September 12-13 meeting of its policy-setting Federal Open Market Committee at 2:00 p.m. EDT.

Data showed September sales looked solid as shoppers wrapped up back-to-school buying and put the brakes on more big spending before the holiday season.

Costco Wholesale shares rose 1.6 percent to $101.25 after it reported a better-than-expected 6 percent rise in September sales at stores open at least a year.

(Editing by Bernadette Baum)