Stocks erased losses to end little changed on Tuesday after a Greek government source said the conservative party leader was expected to deliver a letter of commitment to the country's international lenders.
A sign of Greece's commitment to the tough austerity measures demanded by euro zone leaders was a catalyst for buyers to jump into the stock market late in the session.
Euro zone finance ministers are due to hold a telephone conference call on Wednesday about a 130 billion euros bailout to avert a chaotic Greek default.
Late-day moves by stocks are often exacerbated by dealers who are hedging positions.
There has just been no volume for the last week or so, so you are kind of able to push stocks around a little bit more, said Sam Ginzburg, head of capital markets at First New York in New York.
Bank shares, which have been the most affected by developments out of Greece, cut some of their losses.
The Dow Jones industrial average <.DJI> gained 4.24 points, or 0.03 percent, to 12,878.28. The Standard & Poor's 500 Index <.SPX> dropped 1.27 points, or 0.09 percent, to 1,350.50. The Nasdaq Composite Index <.IXIC> edged up 0.44 points, or 0.02 percent, to 2,931.83.
Materials and financials were the worst performing sectors after rising more than 10 percent for the year.
The benchmark index has encountered strong resistance in the 1,355-1,360 area.
If we don't take out 1,360 on the S&P, the more times we try to take it out and don't, it tells you that we keep making lower highs, which increases the probability that you have your 3, 5, 7 percent selloff, said Ginzburg.
The S&P materials index <.GSPM> lost 1.3 percent as Freeport-McMoRan Copper & Gold
Volume was light with about 6.78 billion shares traded on the New York Stock Exchange, NYSE Amex and Nasdaq, shy of the daily average of 6.96 billion.
Economic data showed a weaker-than-expected gain in January retail sales, which was due in part to discounting in auto sales, but a rebound in an underlying measure of sales pointed to an improving economy.
The S&P retail index <.RLX> gained 0.3 percent after hitting an intraday high of 570.33, the highest level on record for the index.
Auto supplier BorgWarner Inc
According to Thomson Reuters data through Tuesday morning, of the 361 companies in the S&P 500 that have posted results, 63 percent have topped expectations, tracking below recent quarters through this stage in earnings season.
Moody's Investors Service put Britain's Aaa credit rating in jeopardy for the first time late on Monday. The agency also cut its outlook on the top-tier ratings of France and Austria and downgraded the ratings of six euro-zone nations, including Spain and Italy.
Data from Germany suggested Europe's bulwark economy is picking up its pace. The ZEW economic think tank's monthly poll of economic sentiment jumped to 5.4 from minus 21.6 in January, well above the consensus forecast in a Reuters poll of analysts.
Declining stocks outnumbered advancing ones on the NYSE by 1,888 to 1,088, while on the Nasdaq, decliners beat advancers 1,557 to 958.
(Reporting By Chuck Mikolajczak; Editing by Kenneth Barry)