The stock market is desperately looking for good news.
Tuesday, oil prices fell, the euro sank to a 22-month low, and the yield on the U.S. government's 10-year Treasury note fell to near a historic low after a report suggested that Spain will have more trouble repaying its debts.
But stocks rose, anyway. In fact, they had one of their best days in an otherwise dreary month. Investors focused on hopes that China is poised to rev up its economic-growth machine and that upcoming elections in Greece will help the country stay in the euro.
"The overriding news isn't that great," said Robert G. Pavlik, chief market strategist at investment advisers Banyan Partners. "But Greece and China are taking the pressure off the market in the short term."
Gains in industrial stocks that depend heavily on the Chinese economy, such as Caterpillar and Alcoa, helped push the Dow Jones industrial average up 125.86 points. The Dow closed at 12,580.69, up 1 percent.
China is the largest market for aluminum, which Alcoa makes, and Caterpillar recently said that it is aggressively courting China to sell its construction equipment. Both stocks gained 3 percent.
It was only the fifth gain for the Dow this month. The index is down 4.8 percent for May and is headed for its first monthly loss since September. The main culprits behind the decline have been the increasing likelihood that Greece will drop out of the euro currency and a worsening of Spain's financial condition.
The Standard & Poor's 500 index closed up 14.60 points at 1,332.42, and the Nasdaq composite added 33.46 points to close at 2,870.99.
Oil prices fell below $91 after ratings agency Egan Jones downgraded Spain's debt Tuesday. Crude oil prices have been dropping steadily from $106 four weeks ago amid signs of slowing global growth.
Analysts have been concerned that Spain and other weak European economies could drag the European Union into recession this year. It would lead to lower demand from Europe, a continent that consumes 16 percent of the world's oil. It also could harm trading partners such as the United States and China, and slow down global demand for oil.
The worries cited in the report sent the euro to $1.246, its lowest point against the dollar since July 2010. Investors fled to U.S. government bonds, sending the yield on benchmark 10-year Treasury note as low as 1.71 percent, near an all-time low.
Stock investors appeared relieved Tuesday with news from Greece that a party in favor of abiding by the terms of the country's financial rescue could win in national elections next month. That could avoid a catastrophic rift with Greece's international creditors and keep the struggling country within the eurozone.
In Europe, concerns that Spain's ailing banking sector might worsen the European debt crisis sent the Spanish stock market to nine-year lows. Other European markets rose.
Spain's banks are sitting on huge amounts of soured investments in the country's imploded real estate market. That has led to the recent nationalization of Bankia, the country's fourth-largest lender. Bankia revealed last week that it needs far more money in state aid than previously expected, $23.8 billion.
Madrid's Ibex index fell 2.3 percent, and Bankia dropped 13.6 percent.