Stocks managed to end near flat after an extremely volatile session Friday as oil prices lingered around $56 a barrel and investors rebalanced their portfolios due to a reshuffling of the Standard & Poor's 500 index.

The Dow Jones industrial average (search) ended up 3.32 points, or 0.03 percent, to finish at 10,629.67, after falling as low as 10,557.04. The Standard & Poor's 500 Index (search) closed down just 0.56 of a point, or 0.05 percent, to end at 1,189.65, after falling as low as 1,182.78. The technology-laced Nasdaq Composite Index (search) was down 8.63 points, or 0.43 percent, to close at 2,007.79, after falling as low as 1,999.98.

During the session, the Nasdaq briefly fell below the psychologically important 2,000 level for the first time in 2005. It closed at its lowest level since November 2004.

But stocks rallied off their session lows late in the day, pulling the Dow and the S&P 500 back to a position of little change at the close.

All three major indexes posted their second straight week of losses. For the week, the Dow fell 1.34 percent, the S&P was down 0.87 percent, and the Nasdaq lost 1.66 percent. The Nasdaq is down 7.7 percent for the year to date.

Trading was heavy, with 2.34 billion shares changing hands on the New York Stock Exchange, way above the 1.46 billion daily average for last year.

The last time that volume on the NYSE exceeded 2 billion shares was December 2004, making Friday the busiest volume day of 2005.

"It's a really choppy day," Larry Peruzzi, senior equity trader at The Boston Company Asset Management, said. "Everybody is guarded ahead of the S&P re-balance. It's going to be a really big deal in the last half hour of trading. Forty billion worth of stocks will be traded on the close."

Four types of March futures and options contracts expired or settled Friday, a quarterly event that usually stirs high volume as investors adjust or exercise their derivative positions.

An unusual event also coincided with the quadruple witching. The S&P is making adjustments to its benchmark S&P 500 affiliated indexes to full float in 2005. Half of that adjustment was set to take place after the market closed Friday. That event increased trading in some of the stocks involved as fund managers rebalanced their portfolios.

The adjustment means that only the shares available to investors are reflected in the index -- not shares held by a control group, founding family or government.

Oil prices climbed higher, with a barrel of light crude settling at a record $56.72, up 32 cents, on the New York Mercantile Exchange (search).

"Even if we were to see a quick pullback in oil, I don't think that'll reverse the trend, and there are still some negative implications for the market," said Chris Johnson, manager of quantitative analysis at Schaeffer's Investment Research in Cincinnati. "I think you'll start to see companies, like the airlines, fessing up to the fact that these oil prices are going to hurt."

Bonds fell along with stocks Friday, with the yield on the 10-year Treasury note climbing to 4.51 percent, up from 4.46 percent late Thursday. The dollar gained ground against most major currencies, while gold prices fell.

"The fact that bonds are falling has the markets a little worried," said Bryan Piskorowski, market analyst at Wachovia Securities. "The past couple times that oil spiked, bonds rose higher and the equity investors took solace in that. Now you've got to wonder if bonds are feeling the effects of inflation as well."

The technology sector was hit hard by reports that orders for semiconductors were down 22 percent in February year-over-year, even as Deutsche Bank upgraded Intel Corp. (INTC) to a "buy" based on the stock's bargain price. Intel, a Dow component, was unchanged at $23.41, while rival Advanced Micro Devices Inc. (AMD) slipped 9 cents to $16.03 and Texas Instruments Inc. (TXN) was down 20 cents at $25.44.

And Apple Computer Inc. (AAPL) offered some support. Apple rose 1.7 percent, or 71 cents, to $42.96 after Morgan Stanley raised its rating on the shares to "overweight" from "equal weight."

Oracle Corp. (ORCL) shed 62 cents to $12.54 after the company said Harry You, its chief financial officer, is resigning. The departure comes as Oracle works to assimilate PeopleSoft Inc. after its $10.3 billion acquisition. Oracle also increased its bid for software maker Retek Inc., topping German software company SAP AG's previous bid. Retek slipped 18 cents to $11.47, while SAP slid 12 cents to $40.13.

RadioShack (RSH) dropped 11 percent, or $3.11, to $24.60 on the New York Stock Exchange after the electronics retailer cut its earnings forecast, citing weak battery and cell phone sales.

"Folks recognize Radioshack is an important distribution outlet for Sprint and Verizon so any weakness at Radioshack's wireless business could be construed as a potential negative for these two," Will Power of Robert W. Baird said.

Shares of Sprint Corp. (FON) was off 16 cents at $22.80 and Verizon Communications Inc.(VZ) was down 6 cents at $35.15. Qualcomm Inc. (QCOM) fell 41 cents to $36.47.

Citigroup (C) lost 39 cents to $46.85 after the Federal Reserve warned the Dow industrial that it needs to do a better job of regulatory oversight. In a report that ultimately approved Citigroup's takeover of First American Bank, the Fed said future deals could be in jeopardy if Citi doesn't do a better job of adhering to regulations.

Mortgage broker Fannie Mae (FNM) added 51 cents to $55.01 despite an announced delay in filing its annual report with the Securities and Exchange Commission. The company has struggled to restate its inflated earnings, and an additional $2.4 billion in losses could be added to the previous fiscal year.

Continental Airlines Inc. (CAL) lost 18 cents to $10.58 after the airline said it will take a loss in the first quarter and could incur a large loss for all of 2005. Skyrocketing fuel prices have eaten into the company's revenues, and the airline said its April bookings are slightly less than last year.

About 2.11 billion shares were traded on Nasdaq, above the 1.81 billion daily average last year.

Decliners outnumbered advancers on the New York Stock Exchange by nearly 2 to 1 and by 3 to 2 on Nasdaq.

The Russell 2000 index of smaller companies was down 2.96, or 0.46 percent, at 622.50.

Overseas, Japan's Nikkei stock average rose 0.89 percent. In Europe, Britain's FTSE 100 was up 0.02 percent, France's CAC-40 climbed 0.46 percent for the session, and Germany's DAX index gained 0.26 percent.

Reuters and the Associated Press contributed to this report.