Stocks ended the worst week in a year as time runs out on Washington to reach agreement before the U.S. government loses its ability to borrow money.

The S&P 500 fell every day this week and was down 3.9 percent for the week as legislators failed to work out an agreement to raise the federal borrowing limit, which expires on Tuesday. Investors also worry about the likelihood of a U.S. credit downgrade.

The CBOE Market Volatility Index <.VIX>, a gauge of investor fear, jumped as much as 9 percent to its highest level since mid-March before paring its rise.

Natalie Trunow, chief investment officer of equities at Calvert Investment Management in Bethesda, Maryland, said investors are taking a more defensive stance, possibly moving more into cash.

It's frustrating for investors and for U.S. citizens to see this unfold in the way it has been, she said.

From an overall asset allocation standpoint, in an environment like this, you get bigger moves into cash and safe havens.

The Dow Jones industrial average <.DJI> was down 96.87 points, or 0.79 percent, at 12,143.24. The Standard & Poor's 500 Index <.SPX> was down 8.39 points, or 0.65 percent, at 1,292.28. The Nasdaq Composite Index <.IXIC> was down 9.87 points, or 0.36 percent, at 2,756.38.

U.S. President Barack Obama told Republicans and Democrats to find a way out of this mess. The United States will be unable to borrow money to pay its bills if Congress does not raise the debt limit by August 2.

A second attempt for a vote in the House of Representatives is expected after the close of trading on Friday after a bill was modified to try to win over more conservative lawmakers. The measure has little chance of passing in the Senate, however.

At least one credit rating agency has said it is likely to lower the United States' prized tripe-A rating if the cuts in Washington don't go far enough.

Will the deal be enough to satisfy the credit rating agencies is really what's at stake here, Trunow said, whose firm manages about $14.8 billion.

The S&P utility index <.GSPU> is down 2.1 percent for the week, while the Dow is down 4.2 percent and the Nasdaq is down 3.6 percent for the week.

The S&P 500 briefly fell below its 200-day moving average, seen as key support, and bounced back from its worst levels of the day.

Weak economic data also weighed on equities. The U.S. economy stumbled badly in the first half of this year and came dangerously close to contracting in the January-March period.

Among declining stocks, Chevron Corp , the second-largest U.S. oil company, fell 1 percent to $104.02 despite reporting a 43 percent jump in quarterly profit that beat estimates.

(Reporting by Caroline Valetkevitch; Editing by Kenneth Barry)