Stocks fell on Wednesday for the third session in four, with market direction largely dictated by the swings in shares of Apple, the largest company in the world.

The S&P 500 appeared set for a strong move off a nine-month high as Apple Inc shares gained 3 percent in early trading, helped by Tuesday's disclosures that prominent hedge-fund managers had been buying the stock.

But Apple, the largest company by market capitalization, turned negative around midday and closed down 2.3 percent to $497.67, quickly reversing the Nasdaq index's advance. The stock had climbed as high as $526.29 during the session.

The fortunes of both S&P and Nasdaq have been closely tethered to Apple of late, with the benchmark S&P index and Nasdaq a near-perfect correlation over the last 50 days, showing they are moving almost in lockstep.

Doreen Mogavero, chief executive of trading firm Mogavero, Lee & Co, said from the floor of the New York Stock Exchange investors were concerned about a report that Apple had asked online retailer Amazon to halt sales of its iPad in China.

A Chinese technology firm is trying to ban shipments of Apple's iPad tablet in and out of the country in a legal battle over the iPad name.

An Apple spokeswoman said Amazon is not an authorized reseller of iPads in China or the United States.

Volume on the iPhone maker's shares surged to 50 million shares, an increase of over 400 percent when compared with its 30-day average.

This morning, in a bout of panic buying, Apple was up another 17 points, dragging a reluctant market along with it, said Larry McMillan, president of McMillan Analysis Corp. in Morristown, New Jersey, in a report. The sharp decline broke the market, and for the first time in quite a while, an early rally has degenerated into afternoon selling.

The S&P hit a peak of 1,355.87, just shy of its July 2011 high. A break above that level would take the benchmark to its strongest since at least May of last year.

You are looking at good old exhaustion inside of the market, said Keith Bliss, senior vice president at Cuttone & Co in New York. From a technical standpoint, we had strong resistance at 1350, 1355 in the market, and there was no real appetite to get through it.

The Dow Jones industrial average <.DJI> dropped 97.33 points, or 0.76 percent, to 12,780.95. The Standard & Poor's 500 Index <.SPX> lost 7.27 points, or 0.54 percent, to 1,343.23. The Nasdaq Composite Index <.IXIC> fell 16.00 points, or 0.55 percent, to 2,915.83.

Industrial stocks led declines on the S&P 500, with Deere & Co off 5.4 percent at $84.28 after investors expected the farm equipment company to give a stronger full-year forecast.

U.S. manufacturing output rose solidly in January and a gauge of factory activity in New York state hit a 1-1/2-year high in February, adding to a run of fairly upbeat data, even though overall industrial production was flat last month.

Decliners on the Dow, which underperformed the broader market, included industrial and material stocks like Caterpillar Inc , down 1.7 percent at $112.53.

Earlier the Dow industrials were trading near a 3 1/2 high and the Nasdaq was at a more than 11-year high.

Also weighing on the market, European Union sources said finance officials were examining ways of delaying parts or even all of a second bailout for Greece, while still avoiding a disorderly default. That rekindled fears about the region's debt crisis.

(Reporting By Chuck Mikolajczak, additional reporting by Doris Frankel and Rodrigo Campos; Editing by Kenneth Barry)