Stocks regained momentum on Friday, trimming earlier losses to trade near unchanged after the S&P briefly hit a key technical level.

The S&P has fallen four straight days as the stalemate in Washington on a debt-reduction deal spurred selling. Volatility has risen with the outcome of the talks uncertain.

The S&P earlier in the session fell below its 200-day moving average, a key level of technical support, but quickly rebounded.

U.S. President Barack Obama told deeply divided Republicans and Democrats to stop bickering and 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.

Rick Bensignor, chief market strategist at Dahlman Rose in New York, said the turnaround was likely due to computer-driven buy programs designed to be triggered at that level.

When you see a market move that fast, it's machine-driven, he said.

The Dow Jones industrial average <.DJI> dropped 60.39 points, or 0.49 percent, at 12,179.72. The Standard & Poor's 500 Index <.SPX> was down 3.26 points, or 0.25 percent, at 1,297.41. The Nasdaq Composite Index <.IXIC> took off 2.25 points, or 0.08 percent, at 2,764.00.

Analysts still expect lawmakers to reach a deal before August 2. Even if one is not reached, investors expect disruptions to be brief.

It's obviously problematic, but we're not going to default, said Bryant Evans, portfolio manager at Cozad Asset Management, in Champaign, Illinois.

Weak economic data still 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.

Wall Street was on track to post its worst weekly losses in more than a year. The S&P has lost 3.9 percent so far this week. The last time the index fell this much on a weekly basis was in early July last year.

Chevron Corp , the second-largest U.S. oil company, reported a 43 percent jump in quarterly profit, beating estimates as strong oil prices and fatter refinery margins offset a drop in oil output. Still, shares fell 0.4 percent to $104.62.

On the New York Stock Exchange, about two stocks fell for every one rising. Breadth was a little better on the Nasdaq, where ten stocks rose for every 14 falling.

(Reporting by Ashley Lau; additional reporting by Ryan Vlastelica, Chuck Mikolajczak and Caroline Valetkevitch; editing by Jeffrey Benkoe)