The Dow and the S&P 500 ended flat on Friday, giving back earlier gains after the sinking of a South Korean naval ship, while weakness in tech shares kept the Nasdaq in slightly negative territory.

The Dow Jones industrial average <.DJI> rose 9.15 points, or 0.08 percent, to close unofficially at 10,850.36. The Standard & Poor's 500 Index <.SPX> edged up 0.86 point, or 0.07 percent, to finish unofficially at 1,166.59. But the Nasdaq Composite Index <.IXIC> slipped 2.28 points, or 0.10 percent, to end unofficially at 2,395.13.

(Reporting by Angela Moon; Editing by Jan Paschal)