NEW YORK -- That screeching sound you heard in May? That was the stock market.

While the month ended with four days of gains in most of the indexes, concerns that high gas prices, tornadoes and flooding in the South, the post-natural disaster slowdown in Japan and a growing debt crisis in Europe sent the Standard and Poor's 500 stock index down 1.4 percent in May.

That decline followed a 2.85 percent gain in April, which followed gains that set the fastest pace in the first quarter since 1998.

Before May, stocks were boosted by higher corporate earnings, increased business spending and a global economic expansion.

Other risky assets also saw declines in May, following a year of increases. The prices of commodities like oil, cattle and coffee fell by an average of 7 percent.

Meanwhile, Treasury bond prices, which tend to rise when investors fear that the economy is slowing, rose to near their highest level of the year.

For Tuesday, the stock market ended higher, on signs that Germany might drop its demands for an early rescheduling of Greek bonds, paving the way for a deal that could prevent Greece from defaulting on its debt.

--The S&P index gained 14.10, or 1.1 percent, to 1,345.20.

--The Dow Jones industrial average added 128.21, or 1 percent, to 12,569.79.

--The Nasdaq composite rose 38.44, or 1.4 percent, to 2,835.30.

These gains came in spite of another grim report on the U.S. housing market.

Home prices in 12 of the 20 cities tracked by the Standard & Poor's/Case-Shiller index dropped in March to the lowest levels since the housing bubble popped in 2006.

"Home prices continue on their downward spiral with no relief in sight," said David Blitzer, chairman of the index committee at S&P Indices.

Oliver Pursche, president of Gary Goldberg Financial Services, said the report didn't hurt investors' confidence much because their

expectations for the U.S. housing market already were low.

"There's no shock factor there," Pursche said. "We knew it was going to be bad, and it is."

Even so, May was an unhappy month for stock holders for the second year in a row, although the losses weren't nearly as bad as they were last year.

Just like 2010, when the S&P index lost 8 percent in May, Greece said it will need outside help from other European Union countries to meet its debt payments.

And in the U.S., the domestic economy sputtered again. Thirteen economic indicators, ranging from personal spending to manufacturing orders, were weaker than economists had predicted, a sign that investors and analysts said indicates that high gas prices are slowing growth more than anticipated.

Some investors believe that May was merely a short-term dip -- and given the news of the month, markets could have seen bigger declines.

"(Stocks) held up reasonably well this month, given all that the market had to digest in terms of worries," said David Kelly, chief market strategist at J.P. Morgan Funds.

Kelly and others said that the lingering good feelings from a strong earnings season, where the average company beat Wall Street's quarterly earnings expectations by more than 6 percent, was part of the reason the broad market didn't decline further.

One-time factors like bad weather and problems with getting parts from Japan, along with a sharp upturn in investments by private companies, all suggest that the economy will continue to grow this year despite recent signs of weakness, Kelly said.