Stocks erased gains and were little changed on Tuesday as a brokerage's dour view on Microsoft Corp weighed on technology shares, while investors worried that record crude oil prices could squeeze consumers and corporations.

Concern about more credit losses among financial services companies also weighed on sentiment.

Goldman Sachs removed Microsoft from a buy list, saying the software maker's earnings momentum may have peaked in its first quarter.

Microsoft was the biggest drag on the Nasdaq 100 and S&P 500, with its shares falling 1.9 percent to $36.03.

Crude oil futures rose more than $3 to a record high $97 a barrel amid a weaker dollar and supply concerns.

If people start noticing going into the Christmas season they're going to have to spend more at the pump, it might not be a good thing, said Tom Schrader, managing director of U.S. equity trading at Stifel Nicolaus Capital Markets in Baltimore, Maryland.

The Dow Jones industrial average was down 12.44 points, or 0.09 percent, at 13,530.96. The Standard & Poor's 500 Index was down 0.02 point at 1,502.15. The Nasdaq Composite Index was down 8.44 points, or 0.30 percent, at 2,786.74.

I think you're going to continue to see weakness in the financials until we get a sense the subprime and loan debacle at all of these money-center banks and brokerage firms has run its course, Schrader said.

Among financial stocks, shares of Citigroup Inc, the largest U.S. bank, extended losses since the company's warning of $11 billion more in loan losses and the departure of Chief Executive Charles Prince.

Citigroup fell 2 percent to $34.96.