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 Greece and other European countries 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 this month, stocks were boosted by higher corporate earnings, increased business spending, and a global economic expansion.

The Dow was down 193 points, or 1.52 percent, in May, while the Nasdaq lost 37 points, or 1.30 percent.

For the S&P, May was the first down month since August 2010.

Other risky assets also saw declines in May, after a year of increases. The prices of commodities such as 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.06 percent, to 1,345.20. The Dow Jones industrial average added 128.21, or 1.03 percent, to 12,569.79. And the Nasdaq composite rose 38.44, or 1.37 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.

May was an unhappy month for stockholders for the second year in a row - although the losses weren't nearly as bad as they were last year. Just as in 2010, when the S&P index lost 8 percent in May, Greece said that it would need help from other European Union countries to meet its debt payments. And in the United States, the domestic economy sputtered again. Thirteen economic indicators, ranging from personal spending to manufacturing orders, were weaker than economists had predicted, a sign investors and analysts say 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.

The few industries that performed well in May were so-called defensive ones such as health care and utilities that have stable earnings because the items they sell are not luxuries. Consumer staples - companies such as PepsiCo and Costco Wholesale that sell everyday items - rose nearly 2.5 percent, the most of any group.

June should provide some answers as to whether the economy truly is slowing. Economists expect that Friday's jobs report will show that the unemployment rate fell to 8.9 percent in May from 9.0 percent in April. And at the end of the month, the Federal Reserve will end its bond-buying stimulus program, QE2.

The S&P index has risen 7 percent this year, before dividends. At this point, it would take an 87.56-point drop for it to turn negative for the year. The Dow would need to drop 992.28 points to erase its 8.57 percent gain for the year.