Updated from 4:31 p.m. EDT

Stocks in New York rallied in the final minutes of May trading perhaps due to some end-of-month window-dressing, after crude oil settled above $66 a barrel, the dollar continued to weaken and investors prepared to say goodbye to old

General Motors

(HP) - Get Report

.

The

Dow Jones Industrial Average

rose 96.53 points, or 1.2%, to 8500.33, while the

S&P 500

was 12.31 points, or 1.4% higher, at 919.14. The

Nasdaq

was better by 22.54, or 1.3%, at 1774.33.

The late-day rally was partly fund managers readjusting portfolios for the end of the month, says Anu Sharma, managing director of the Market Intelligence Desk at Nasdaq OMX. Some of the movement also could have also been due to index managers, as today was the MSCI semiannual rebalance, and today's market caps will be used for the Russell rebalance the last day of June, he says.

For the week, the Dow was up 2.7%, the S&P 500 up 3.6%, and the Nasdaq higher by 4.9%. The expression "sell in May and go away" did not hold: The Dow was up 4.1%, the S&P 500 was higher by 5.3%, and the Nasdaq added 3.3% for the month.

Coca-Cola

was the strongest performer on the Dow for the day, rising 4.8%.

Merck

(MRK) - Get Report

and

Pfizer

(PFE) - Get Report

also rose 3% and 3.4%, respectively.

GM was the biggest loser, trading down 33%. GM shares fell 37 cents to 75 cents, a record low dating back to the 1930s. The

UAW ratified

a new deal with the struggling U.S. automaker on Friday. A day earlier, GM made

a tentative deal

with unsecured bondholders, who would get 10% of the company. It would allow GM to proceed with a bankruptcy filing.

GM has reportedly also reached a

tentative deal

with Canadian auto-parts maker Magna to sell its German unit, Opel, ahead of its expected bankruptcy filing next week.

Crude oil continued to rise, gaining $1.23 to settle at $66.31 a barrel, a day after data showed that inventories fell again last week, and after

OPEC

decided to keep its production targets unchanged, reportedly eyeing an uptick in demand. May could represent the largest monthly gain in oil futures in nearly a decade.

"The market has been signaling better demand and tighter supplies to come, and it has hard evidence, not just in the raw data but in the other macro and political factors that have been played out," writes Phil Flynn, energy analyst at Alaron Energy.

Integrated oil stocks

Chevron

(CVX) - Get Report

,

Chesapeake Energy

(CHK) - Get Report

, and

BP

(BP) - Get Report

all added more than 1%.

Although institutional money came into the market in the beginning of the new quarter, not a lot was put to work in the second half of April and in most of May, says Nasdaq's Sharma, calling it a trader's market.

"It's starting to feel like things are moving sideways in the last month," says James Holtzman, financial adviser with Legend Financial Advisors. "You still hear a lot of optimism, but we're not really seeing it in the numbers. What it comes down to is that we're not out of the woods yet, the problems don't clear

in a two-month rally."

But the positive is that there seem to be fairly tight trading ranges, says Nasdaq's Sharma. "It gives a sense of comfort that things will flatten out a bit, and we may not see that huge drop-off that a lot of people thought we would see," he says.

Investors waiting for a big-picture view of the economy got just that. The Department of Commerce said early Friday that

gross domestic product

decreased at an annual rate of 5.7% in the first quarter of 2009, according to the latest estimates. That's slightly better than the original estimate for a 6.1% decrease, although analysts had anticipated the latest gauge would show a 5.5% decline.

GDP fell 6.3% in the fourth quarter. The smaller decrease in the more recent quarter reflected a larger decrease in imports, an increase in spending on big-ticket items and a smaller decline in spending on nondurable goods, according to the report.

Other economic data offered a mixed picture. On a positive note, the University of Michigan Consumer Sentiment Index increased to 68.7 from 67.9, slightly better than expectations for 68. On the other hand, the Chicago purchasing managers index fell unexpectedly to 34.9 from 40.1 the month prior, while economists had predicted an increase.

Longer-dated Treasuries, which played strongly on the equities throughout the week, were rising in price; the 10-year was higher by 1-8/32, to yield 3.46%, and the 30-year was up 2-16/32, yielding 4.33%.

The dollar was weaker vs. the pound, euro and yen, and gold rose $17.10 to $980.30.

In earnings,

Dell

(DELL) - Get Report

and

Tiffany

(TIF) - Get Report

both reported steep declines in quarterly profit, as expected.

Dell and Tiffany shares tacked on 0.8% and 0.9%, respectively.

In other news, KBW upgraded

Morgan Stanley

(MS) - Get Report

to outperform from market perform and raised its price target on the stock, sending shares 3% higher, while the KBW Bank Index rose 1.9%.

Also JPMorgan upgraded

Office Depot

(ODP) - Get Report

to overweight from neutral. Shares surged 6.4% to $4.66.

Meanwhile, a judge will determine on Friday whether it's best for U.S. automaker Chrysler and its stakeholders to sell most of the company to Italian automaker

Fiat

.

Auto-parts maker Delphi may emerge from bankruptcy, just after

auto-parts supplier Visteon

said it has now filed for Chapter 11 bankruptcy protection.

Stocks overseas were mixed. In Europe, London's FTSE 100 and Frankfurt's Dax were higher by 0.7% and 0.2%, respectively, after paring gains from earlier in the session. In Asia, Japan's Nikkei and Hong Kong's Hang Seng gained 0.8% and 1.6%, respectively.