US stocks closed in positive territory Tuesday, clawing back from losses after reports that Greece was nearing a bailout deal to avoid defaulting on its debt.
The Dow Jones Industrial Average rose 33.07 points (0.26 percent) to finish the session at 12,878.20.
The broad-based S&P 500 added 2.72 points (0.20 percent) to 1,347.05 while the Nasdaq Composite edged up 2.09 points (0.07 percent) to 2,904.08.
Stocks started the session on a sour note but finished with gains after positive noises out of Europe.
"Fueling the bulls were escalating hopes for a Greek debt deal, with the country's lawmakers reportedly close to securing multi-agency bailout funds by agreeing to extra austerity measures," said Andrea Kramer at Schaeffer's Investment Research.
Traders also kept an eye on Federal Reserve chairman Ben Bernanke, who in testimony to the Senate Budget Committee reiterated his concerns about high levels of US unemployment just days after a surprisingly large drop in the jobless rate.
Investors cheered better-than-expected earnings from Dow member Coca-Cola and fast-food giant Yum! Brands, owner of the Kentucky Fried Chicken and Pizza Hut chains.
Both companies reported strong sales growth in China. Coca-Cola was up 0.8 percent and Yum! jumped 2.6 percent.
McDonald's led the Dow higher, adding 1.4 percent.
Citigroup fell 0.7 percent. The bank said it had won permission to issue credit cards in China, a first for a foreign bank.
US telecom giant Verizon dropped 0.6 percent and Coinstar, operator of Redbox movie rental kiosks, leaped 13.8 percent after announcing a joint venture to launch an online streaming video service to challenge market leader Netflix.
Netflix fell 1.1 percent.
Oracle slipped 0.2 percent after rejecting a $272 million damages award in its copyright infringement lawsuit against German business software rival SAP and asking for a new trial.
Bond prices fell.
The yield on the 10-year Treasury rose to 1.97 percent from 1.90 percent on Monday, while the 30-year increased to 3.14 percent from 3.09 percent.
Bond prices and yields move in opposite directions.