The S&P 500 brushed up against a bear market on Tuesday, but investors rushed in to buy technology and other beaten-down sectors and stocks ended the day sharply higher.

Based on the latest available data, the Dow Jones industrial average <.DJI> was up 151.52 points, or 1.42 percent, at 10,806.82. The Standard & Poor's 500 Index <.SPX> was up 24.52 points, or 2.23 percent, at 1,123.75. The Nasdaq Composite Index <.IXIC> was up 68.99 points, or 2.95 percent, at 2,404.82.

(Reporting by Caroline Valetkevitch; Editing by Kenneth Barry)