Google's blowout quarter led the Nasdaq higher on Friday, but mounting uncertainty about the government's ability to reach a debt-reduction deal may keep investors at bay in the coming week.

The gains were a bright spot in a stretch dominated by selling that pushed the S&P 500 to its worst week in five. Worries about U.S. and European government debt troubles put pressure on the market even as investors expect a batch of strong corporate results next week.

The Dow Jones industrial average <.DJI> was up 42.61 points, or 0.34 percent, to end unofficially at 12,479.73. The Standard & Poor's 500 Index <.SPX> was up 7.28 points, or 0.56 percent, to finish unofficially at 1,316.15. The Nasdaq Composite Index <.IXIC> was up 27.13 points, or 0.98 percent, to close unofficially at 2,789.80.

For the week, the S&P 500 ended down 2 percent while the Dow lost 1.4 percent and the Nasdaq fell 2.4 percent.

(Reporting by Ryan Vlastelica; Editing by Jan Paschal)