NEW YORK (TheStreet) -- U.S. stocks advanced more than 1% Tuesday amid positive headlines out of Greece and China, even as the euro fell on worries about a deepening debt crisis across the pond.

Investors cheered new opinion polls that showed a shift in favor of austerity measures in Greece, boosting optimism that the country will remain in the euro zone. There was also some excitement about fresh stimulus measures from the Chinese government, news that led Asian stock markets higher.

Mixed economic data in the U.S. and another cut to Spain's credit rating from Egan Jones attempted to keep gains in check mid-session, but stocks still managed to close on a high note.

The Dow Jones Industrial Average gained 125 points, or 1%, to close at 12,580. The blue-chip index had run as high as 12,611.

The S&P 500 gained 15 points, or 1.1%, to finish at 1332. The Nasdaq rose 3 points, or 1.1%, to settle at 2871.

Basic materials, capital goods and technology led the way Tuesday; although every group was in green. Within the Dow, 28 of the index's 30 components finished higher, led by Bank of America ( BAC), Alcoa ( AA), Caterpillar ( CAT), and United Technologies ( UTX).

Exxon Mobil ( XOM) and McDonald's ( MCD) were the only stocks to finish in the red on the index.

Peter Cardillo, chief market economist at Rockwell Global Capital, attributed some of the strength to the steady selling that's dominated so far in May.

"I think we'll have an upward defensive market for most of the week," he said. "The market has reached oversold conditions and basically it's cheap in terms of valuations and present economic U.S. growth."

Tuesday's gains mark only the fifth such positive session for the Dow in the month of May. The major averages are still set to register their worst performance since September, with the Dow down about 5% in the past month. The Nasdaq and the S&P 500 have also given up between 5% and 6% each.

Cardillo also sees a good chance that Greece may ultimately remain part of the eurozone, a scenario that the market seemed to be planning against last week.

"I personally, contrary to other observers, I think that Greek elections will favor the nation staying in the Euro," he said. "The market needs to believe that."

London's FTSE settled up 0.7%, and the DAX in Germany closed up 1.2%, after political parties supporting austerity measures mandated by the European Union were shown to be receiving growing support in Greek opinion polls, with one of the pro-bailout parties coming in at the top in six polls published over the weekend.

Spain, however, was an ongoing source of concern across the pond as borrowing costs have spiked to their highs of the year since details of the country's $24 billion bailout for partially nationalized institution Bankia came to light late last week. The Spanish stock market fell sharply with banks leading the way, and is now down roughly 25% this year.

The euro was sitting near two-year lows against most other major currencies as discussions on how to fund the recapitalization of Bankia, which is Spain's fourth-largest lender, fueled anxiety about a worsening eurozone debt crisis.

Fresh stimulus measures from China's government were a bright spot earlier in the day. The country's top planning agency has given the green light for construction of a number of new steel plants.

"Once they start, they will maintain this," Matt Lloyd, chief investment strategist at Advisors Asset Management, said of the news from China. "I could see a run back up to the 9% level in GDP in China by the end of the year."

In domestic economic news, the S&P Case/Shiller Home Price Index of 20 cities for March fell 2.6% from a year ago, as expected by economists surveyed by Thomson Reuters, after a 3.5% decline in February. But month-over-month, home prices rose in most major U.S. cities for the first time in seven months.

"The Case-Shiller home price index is pointing to further improvement in housing market activity, consistent with other housing market indicators," said Millan Mulraine, senior U.S. strategist at TD Securities.

The Conference Board said that its read on consumer confidence for May fell to 64.9 from a downwardly-revised 68.7 in April. Economists expected a reading of 70.

"The fall in the Conference Board measure of US consumer confidence to a four-month low of 64.9 in May, from 68.7 in April, suggests that the sharp drop back in stock markets was the dominant factor taking a toll on the mood of consumers," wrote Amna Asaf, an economist at Capital Economics. "Along with an apparent deterioration in labor market conditions, the drop in equity prices, triggered by more bad news out of Europe, appears to have more than offset any boost to confidence from the continued drop back in gasoline prices."

Commodities were lower with July crude oil futures moving down 10 cents to settle at $90.76 a barrel and the June gold contract slipped $20.2 to settle at $1,548.70 an ounce.

The benchmark 10-year Treasury was lower 1/32, raising the yield to 1.748% and the greenback was back to trading flat after rising earlier in the session, according to the dollar index.


In corporate news, Facebook ( FB) is reportedly in talks to buy Opera Software, a Norwegian maker of Internet browsers, for a potential price tag of more than $1 billion. The stock continues to suffer from a downward spiral since its debut, with shares plummeting below the $30 market. The stock shed nearly 10%.

JPMorgan Chase ( JPM) has sold about $25 billion of profitable securities to try to offset losses related to its massive derivatives trading loss. The shares were flat amid a raft of analyst estimate cuts and reports that it is under scrutiny in Japan in a widening probe on insider trading. Shares gained 0.4%.

Other bank stocks were showing strength however, despite the negative news. Bank of America ( BAC) jumping 4%, while Citigroup ( C) gained more than 2%.

Shares of Chesapeake Energy ( CHK) gained 3.4% after activist investor Carl Icahn revealed after the close Friday that he had purchased a 7.6% stake in the embattled oil and gas company.

Icahn called for the replacement of at least 4 board members of Chesapeake Energy, excluding only former Warren Buffett lieutenant and current Chesapeake board member Louis Simpson from his ire at the board for failing to hold management accountable.

Shares of Vertex Pharmaceuticals ( VRTX) plunged 11% after the company acknowledged it had overstated the response to its two-drug cystic fibrosis therapy earlier this month because of the misinterpretation of interim data from a Phase II study.

Apple ( AAPL) shares rose 1.8%. CEO Tim Cook is set to kick off the D10 technology conference in Rancho Palos Verdes, Calif. Tuesday evening.

After the bell, Research in Motion ( RIMM) shares tumbled after the BlackBerry maker forecast an operating loss for its fiscal first quarter and said it's hired bankers for advice on strategic options.

Shares of the struggling company, which also said it's planning layoffs, fell more than 12% in extended trading.

-- Written by Andrea Tse and Shanthi Bharatwaj in New York.

>To contact the writer of this article, click here: Andrea Tse.

More from Markets

Dow Fluctuates, Nasdaq Strikes Record High

Dow Fluctuates, Nasdaq Strikes Record High

Airlines Rebuke Trump Policy of Separating Children

Airlines Rebuke Trump Policy of Separating Children

3 Must Reads on the Market From TheStreet's Top Columnists

3 Must Reads on the Market From TheStreet's Top Columnists

Deutsche Bank Fined $205 Million Over Currency-Trading Violations

Deutsche Bank Fined $205 Million Over Currency-Trading Violations

Instagram Launches New Longform Video Platform

Instagram Launches New Longform Video Platform