Stocks dropped on Wednesday, ending a three-day rally, as energy and other commodity shares sank, fueling worries about the market's ability to pursue its upward path.

A stronger dollar and ample U.S. fuel supplies sent crude oil prices down sharply and knocked the S&P index of energy stocks <.GSPE> 3 percent lower.

Other commodities tumbled. The iShares Silver Trust exchange-traded fund was down 8.4 percent at $34.34.

The losses followed a similar collapse in commodities less than a week ago, a rout that fueled speculation how stocks would be affected. Energy and materials shares had been the top performing sectors in the past two quarters when stocks rallied.

The Dow Jones industrial average <.DJI> was down 157.99 points, or 1.24 percent, at 12,602.37. The Standard & Poor's 500 Index <.SPX> was down 17.73 points, or 1.31 percent, at 1,339.43. The Nasdaq Composite Index <.IXIC> was down 33.56 points, or 1.17 percent, at 2,838.33.

The S&P energy sector is down 7.8 percent since the start of the month.

Wednesday's decline was broad, however, with 13 stocks falling for every two rising on the New York Stock Exchange.

In a sign of weakness, the S&P 500 broke below 1,340, a key technical level, and some analysts said a close below 1,330 would be bearish for the market.

The 1,340 level roughly coincides with the 20-day average, which the market has closed above since April 20. If the S&P 500 closes below that, the Bollinger bands chart set a near-term target just above 1,300.

The market would have to drop below 1,300 to get any real damage done ... to even call the trend into question, said Carter Worth, chief market technician at Oppenheimer & Co in New York.

The euro dropped to a fresh three-week low against the dollar as investors unwound risky trades in commodities and higher-yielding currencies and bought back the greenback in a flight to quality bid.

Among the day's advancers were some consumer discretionary shares including Macy's Inc , which jumped 7.6 percent to $28.33 after its profit topped estimates. The department store chain also offered an optimistic outlook for the rest of 2011.

(Additional reporting by Chuck Mikolajczak; Editing by Kenneth Barry)