U.S. stocks fell late on Friday as a spike in oil prices revived worries that inflation would derail the recovery, jolting a market that had been treading water ahead of corporate earnings.

The uncertain outcome of budget talks in Washington and the prospect of a U.S. government shutdown as a midnight deadline loomed spurred investors to buy protection ahead of the weekend. Many traders bought short-term put options on the SPDR S&P 500 Trust .

The tape is heading south in light volume. People are hoping that nothing bad happens over the weekend, said Michael James, senior trader at regional investment bank Wedbush Morgan in Los Angeles.

The surge in oil prices drove down shares of airlines and transportation companies. The Arca Airline index <.XAL> shed 2.7 percent and the Dow Jones Transportation Average <.DJT> fell 1.7 percent.

Brent crude futures settled above $126 a barrel, the highest level in 32 months, as the weak dollar drove up commodities and intense fighting in Libya raised fears of prolonged supply cuts.

Trading volumes remained low, a sign that investors are holding off major new bets ahead of the release of quarterly earnings beginning next week.

The Dow Jones industrial average <.DJI> was down 29.59 points, or 0.24 percent, at 12,379.90. The Standard & Poor's 500 Index <.SPX> was down 5.36 points, or 0.40 percent, at 1,328.15. The Nasdaq Composite Index <.IXIC> was down 15.73 points, or 0.56 percent, at 2,780.41.

For the week, the Dow rose 0.03 percent while the S&P 500 and Nasdaq each lost 0.3 percent.

Trading volume was 6.47 billion shares on the New York Stock Exchange, NYSE Amex and Nasdaq, compared with last year's estimated daily average of 8.47 billion.

The S&P faces resistance around 1,345, near its 2011 high. Many analysts believe earnings could be the catalyst that pushes the benchmark index through that resistance.

If the earnings next week are robust enough, we might go above 1,350, which is the top of the trading range. But since the market is very complacent, we might easily turn the other way if we see a negative outlook, said James Meyer, chief investment officer at Tower Bridge Advisors in West Conshohocken, Pennsylvania.

The earnings season will begin unofficially when Dow component Alcoa Inc reports results after the market's close on Monday. JPMorgan Chase & Co and Google Inc are due to report later in the week.

Bullishness has risen to levels not seen since last December before earnings, according to a survey by Investors Intelligence.

Bucking the downtrend on Friday, commodity-related shares rose with higher oil and metals prices. Occidental Petroleum Corp rose 2.6 percent to $103.72 and the S&P Energy index <.GSPE> was up 0.4 percent.

Copper rose 2.5 percent while gold hit record highs on Friday and silver reached its strongest level since early 1980, as investors snapped up inflation-sensitive raw materials as a hedge. U.S.-listed shares of miner Rio Tinto Plc rose 2.1 percent.

The White House and Congress faced a midnight deadline to break a budget deadlock. Democratic and Republican leaders said there was still no overall deal on government funding for the rest of the fiscal year.

For graphics on S&P 500 performance during the two government shutdowns in 1995 and 1996, see http://r.reuters.com/guw88r.

(Reporting by Angela Moon, Editing by Leslie Adler)