NEW YORK (Reuters) - U.S. stocks sold off late in the day to close at session lows on Wednesday as talks to avert a year-end fiscal crisis turned sour, even as investors still expect a deal.

The S&P 500 slipped after a two-day rally that took the benchmark index to its highest close in two months. Defensive-oriented shares led the decliners, including health care and consumer staples.

General Motors (GM.N) bucked the overall weakness to surge 6.6 percent to $27.18 after the automaker said it will buy back 200 million of its shares from the U.S. Treasury, which plans to sell the rest of its GM stake over the next 15 months.

President Barack Obama and congressional Republicans are struggling to come up with a deal to avoid early 2013 tax hikes and spending cuts that many economists say could send the U.S. economy into recession.

House Speaker John Boehner, the top Republican in Congress, said in a one-minute press conference that his chamber will pass a proposal that Obama had already threatened to veto as it spares many wealthy Americans from tax hikes needed to balance the budget. Obama has already agreed to reductions in benefits for senior citizens.

"My guess is they're close to a deal, and right before, it looks like the deal is about to blow up either on manufactured or legitimate reasons," said Uri Landesman, president of hedge fund Platinum Partners in New York.

He said if the market thought a deal was in real danger, the S&P 500 would slide below 1,400. It stands now near 1,435, not far from a two-month high.

The CBOE Volatility Index .VIX surged 11.5 percent to 17.36, but has remained relatively stable. Its 14- 50- and 200-day averages are all within 1.1 points.

Landesman said the VIX's stability indicates "the bulls have control of this market still."

Banks and energy shares - groups that outperform during periods of economic expansion - have led recent gains, indicating a shift to focusing on a growing economy as Wall Street looks past the budget talks.

Herbalife Ltd (HLF.N) shares tumbled 12.1 percent to $37.34 after William Ackman, one of the world's biggest hedge fund managers, said he is shorting the stock of the weight management products company.

Knight Capital Group Inc (KCG.N) climbed 5.4 percent to $3.51 after it agreed to be bought by Getco Holdings in a deal valued at $1.4 billion. The stock, which nearly collapsed after a trading error in August, remains down about 70 percent so far this year.

Shares of Chinese display advertising provider Focus Media Holding Ltd FMCN.O jumped 6.7 percent to $25.52 after it agreed to be bought by a consortium of private equity funds led by the Carlyle Group (CG.O) for about $3.6 billion.

Data showed homebuilding permits touched their highest level in nearly 4-1/2 years in November. The PHLX housing index .HGX fell 0.8 percent, but has gained 66.4 percent this year as the housing market has turned the corner.

About 6.9 billion shares changed hands on the New York Stock Exchange, the Nasdaq and NYSE MKT, slightly above the daily average so far this year of about 6.45 billion shares.

Advancing and declining issues were almost even on both the NYSE and the Nasdaq.

Trending On Reuters

REUTERS EXCLUSIVE

India's main public health programmes, aimed at millions of rural poor, have been in disarray for months because the government changed the way that over $1.3 billion in funds were distributed, according to data and letters seen by Reuters. Full Article | Graphic: India's health funding