Stocks fell on Wednesday after a hefty year-end rally and the S&P 500 erased gains for the year as investors shifted focus to what is expected to be a difficult start to 2012.

After a 5 percent rally last week that helped Wall Street post its best quarter in over a year, the S&P 500 pulled back below its 200-day moving average, a closely watched indicator of market strength it has struggled to hold this year.

Investors concentrated on 2012, with Europe's debt crisis as well as a slowdown in Asia and the impact of Europe's recession on a U.S. recovery on the agenda.

There are clearly some major hurdles on the horizon, said Peter Kenny, managing director at Knight Capital in Jersey City, New Jersey. Looking into next year, there is more apprehension about the risks associated with the current climate.

The biggest gaining sectors over the last five days, in cyclical areas like materials and energy, led the market lower on Wednesday, sparked by a dip in commodity prices. The S&P materials sector <.GSPM> fell 2.2 percent.

The Dow Jones industrial average <.DJI> slid 135.74 points, or 1.10 percent, at 12,155.61. The Standard & Poor's 500 Index <.SPX> was down 15.18 points, or 1.20 percent, at 1,250.25. The Nasdaq Composite Index <.IXIC> took off 31.99 points, or 1.22 percent, at 2,593.21.

The euro and European stocks weakened as the boost from the drop in Italian borrowing costs faded in thin trading ahead of a sale of longer-term debt by the same country on Thursday.

Wall Street movements have been closely correlated to European markets in recent weeks as the region struggles with the debt crisis. Although concerns subsided somewhat recently, they were in evidence again on Wednesday as equities slid.

This is all euro related, said Roger Volz, director of cash equities at BGC Financial in New York and it started affected equities. It's having ripple effects across the board and now people are moving out of commodities.

Gold dipped, tracking industrial metals, on concerns about the prospects for global economic growth next year. It was the biggest one-day decline in the precious metal in two weeks.

For the year, the Dow is up 5.3 percent, while the S&P is down 0.2 percent, and the Nasdaq is off 1.9 percent. For the quarter, the S&P 500 is up nearly 11 percent.

Medicis Pharmaceutical Corp fell nearly 3 percent to $32.77 a day after cutting its fourth-quarter earnings outlook.

Citigroup Inc was off 3.1 percent to $26.06 after U.S. regulators won a delay in a securities fraud lawsuit against the bank. The U.S. is seeking to appeal a judge's decision to reject its $285 million settlement with the bank.

Volume was light in the post-Christmas period and ahead of the New Year's Day holiday. Composite volume on the New York Stock Exchange, the Nasdaq and Amex was 1.8 billion shares, well below average. On the NYSE, more than four stocks fell for every one that rose.

(Reporting by Edward Krudy; editing by Jeffrey Benkoe)