Stocks rose sharply on Thursday after the latest Treasury auction garnered strong demand, pressuring bond yields, while consumer discretionary shares gained.

The auction of $27 billion of 7-year notes completed this week's sales of Treasury coupons, with all three auctions seeing solid demand.

Had they not been as strong as they have been, it would have continued the concern rates would move higher, and that would have potential to give us another headwind for economic recovery, said Bucky Hellwig, senior vice president at Morgan Asset Management, in Birmingham, Alabama.

Rising bond yields tend to mean higher borrowing costs for businesses and consumers.

Retail and other consumer discretionary shares also underpinned the market.

Retailer Bed Bath & Beyond Inc reported a surprising increase in quarterly profit as it cut costs to offset slumping demand, and its stock gained 10.1 percent to $31.25. The retail index <.RLX> was up 3.5 percent.

The Dow Jones industrial average <.DJI> was up 145.86 points, or 1.75 percent, at 8,445.72. The Standard & Poor's 500 Index <.SPX> was up 15.11 points, or 1.68 percent, at 916.05. The Nasdaq Composite Index <.IXIC> was up 27.31 points, or 1.52 percent, at 1,819.65.

Earlier, all three indexes gained as much as 2 percent to 2.29 percent to hit session highs.

There was also some relief in the market that Federal Reserve Chairman Ben Bernanke had weathered a tough grilling in Congress relatively well.

(Additional reporting by Leah Schnurr; Editing by Jan Paschal)