The Dow and the S&P 500 rose on Friday as surging oil prices lifted energy stocks and offset a sell-off in technology shares on bets that the slowing economy will sap consumer spending on gadgets.

The Dow Jones industrial average <.DJI> gained 32.50 points, or 0.49 percent, to end unofficially at 6,626.94. The Standard & Poor's 500 Index <.SPX> rose 0.83 of a point, or 0.12 percent, to 683.38. But the Nasdaq Composite Index <.IXIC> dropped 5.74 points, or 0.44 percent, to 1,293.85.

(Reporting by Rodrigo Campos; Editing by Jan Paschal)