Wall Street sealed the third month of its spring rally with a huge advance. The fourth month looks a little less certain.

Stocks shot higher right before the closing bell Friday after fluctuating on a mix of economic data. Analysts said the surge was the work of short-sellers who had bet that stocks would fall and then had to rush to buy when those bets turned out to be wrong.

A jump in commodities prices, which came on expectations that an improving economy will lift demand for raw materials, also fed the advance.

Even though Wall Street ended May with a big win, it was the shakiest month of the spring rally that started in early March with the first signs that the economy's slide was slowing. When trading resumes Monday, investors are expected to show more of their recent skepticism about how strong the recovery will be once the recession has ended.

New worries are weighing on investors including climbing interest rates and a weaker dollar. Crude oil prices recently hit a six-month high above $66 a barrel, while the dollar on Friday sank to its lowest level in months against the euro and British pound. Some analysts say these developments are simply the consequence of a recovery in the economy and the financial markets, but others say the trends could threaten the economy's health in the long term.

Another more short-term obstacle is General Motors Corp.'s expected bankruptcy filing on Monday. The market has been factoring in the likelihood of a GM bankruptcy for months, but investors still are unsure what the fallout might be for auto suppliers and other companies.

"Technically, the market is looking quite good," said Peter Cardillo, chief market economist at the brokerage house Avalon Partners Inc. "Although, I suspect we'll probably stay within this trading range for another couple of weeks."

All three indexes rose sharply for the week and, more importantly, had their third straight monthly gain. The Dow is up 4.1 percent for May, the S&P 500 index is up 5.3 percent, and the Nasdaq is up 3.3 percent.

Wall Street's advance since it hit 12-year lows on March 9 has been stunning, even with the unsteadiness the market has shown in May.

The Dow is up 29.8 percent, while the S&P 500 index is up 35.9 percent and the Nasdaq is higher by 39.9 percent.

Even with those gains, stocks are still down from their peak in October 2007, two months before the start of the recession. The Dow is off 40 percent, the S&P 500 index is lower by 41.3 percent and the Nasdaq is down by 37.9 percent.

Friday's economic data prevented the market from finding a direction for much of the day. Commerce Department's report on first-quarter gross domestic product showed the economy contracted at an annual rate of 5.7 percent, a bit more than analysts' forecasts. Also, personal spending was revised lower. But the drop in GDP was smaller than the 6.1 percent estimated last month, and the report showed corporate profits rising.

The report "points to recovery," Cardillo said. "And what you have here is a market that continues to look for recovery."

The Chicago-area purchasing executives monthly report of Midwest manufacturing activity showed a bigger decrease in May than in April. Analysts had anticipated a smaller contraction. The report is viewed as a precursor to the Institute for Supply Management's national manufacturing index, due Monday.

But helping counteract that disappointing report was the University of Michigan's index of consumer sentiment, which showed a larger-than-expected increase in May. Another report earlier in the week suggested an upswing in consumer confidence, too.

Besides the ISM report on Monday, the coming week has a series of critical economic data that will help determine the market's next move, including pending home sales, retailers' sales figures and, next Friday, the government's employment report for May.

Government bonds rose Friday, pushing yields lower. The yield on the benchmark 10-year Treasury note, which moves opposite its price, fell to 3.46 percent from 3.62 percent late Thursday.

The 10-year yield hit a six-month high of 3.75 percent on Wednesday. Spiking interest rates earlier this week stoked concerns about Americans' ability to borrow and refinance mortgages.

Oil prices have been jumping to six-month highs as the dollar tumbles. Light, sweet crude rose $1.23 to settle at $66.31 a barrel on the New York Mercantile Exchange. Gold and silver prices rose as well.

Wall Street is a little ambivalent about crude's advance. On one hand it poses the threat of inflation, and if energy is too expensive that could curb the economy's rebound. However rising commodities prices are often seen as an indicator of economic health as business activity picks up.

Rising commodities prices have also driven some of the best performers in the stock market over the past month: Metal and coal producers, miners and pipelines.

Technology stocks have also gained in recent weeks.

The weakening dollar is also drawing more investors, like Robert Pavlik of Banyan Partners LLC, to the stocks of multinational companies. Those companies can export more and earn higher overseas revenues when the dollar is down, he said.

The worst performers in May were companies tied to the housing market and discretionary spending, such as construction companies, home improvement retailers, furniture makers and consumer electronics sellers. And financial stocks, while holding up, have not been leading the market higher as they were in March and April.