"It's a Detroit market at least in the beginning, with renewed enthusiasm based on the news out of Detroit," said Peter Cardillo, chief market economist at Avalon Partners.
The Dow Jones Industrial Average rose 117.2 points to 13,895.9.3, with 26 of its 30 components ahead. GM's shares set the pace, up 9.7%, followed by Alcoa Inc. , up 3.6%.
Boeing Co. , the world's largest aerospace company, fronted the Dow's declines, its stock off 0.6%.
Caterpillar Inc. was also among the Dow's declining factors, its stock off 0.3%. The equipment manufacturer said in a regulatory filing that it had reached a five-year credit agreement for $1.63 billion in unsecured credit.
Technology bellwether Hewlett-Packard Co. joined the Dow's declining components, its stock off 0.6%.
The S&P 500 added 11.37 points to 1,528.58 and the Nasdaq Composite climbed 18.64 points to 2,702.09.
Trading volume came to more than 1 billion on the New York Stock Exchange, with advancing stocks topping decliners more than 2 to 1.
On the Nasdaq, volume reached 1.7 billion shares, and advancing stocks outran decliners 4 to 3.
Shares of Bear Stearns Cos. Inc. gained 13% on a New York Times report that outside investors including Warren Buffet was considering buying a minority stake in the brokerage.
Oil and gas shares were mixed after gaining earlier on in taking their cue from oil giant Chevron Corp.'s plans for a $15 billion stock buyback.
The Amex Oil Index moved 0.5% lower and the Amex Natural Gas Index fell 0.3%. Shares of Chevron gained 1%.
Crude-oil futures climbed $1.23, or 1.5%, at $80.72 a barrel, after slumping earlier on after the Energy Department reported the first rise in U.S. crude supplies in five weeks. .
Soft reading on capital spending
Ahead of the opening bell, futures for the major stock indexes briefly trimmed early gains after the Commerce Department reported the largest monthly decline in durable-goods orders since January: a 4.9% drop in August after a 6.1% gain in July. .
"Durable goods were a little less than expected, and point to moderate growth ahead," said Cardillo.
While the retreat proved larger than the anticipated 4.5% fall, the "very elevated levels the month prior" make it difficult to "extrapolate much from the data," said analysts at Action Economics.
"Perversely, the weak durables report is also seen as supportive of another Fed rate cut, despite hawkish noises from [Philadelphia Fed president Charles] Plosser overnight," said Action Economics. .
Among the most active, GM shares gain in light of the Detroit-based auto maker's pact with the UAW, which includes plans for an independent retiree health-care trust. .
The tentative pact between GM and the UAW is "important news" for GM, but investors remain a bit cautious otherwise, looking ahead to third-quarter earnings the impact of the housing crisis on consumer spending, said Art Hogan, chief market strategist at Jefferies & Co. .
Merrill Lynch Co. Inc. shares fell 2.9% after Goldman Sachs analysts lowered their earnings forecast for the brokerage, citing "an extremely challenging operating environment" in the third quarter.
Shares of Newmont Mining Corp. slid 6.2% after the Denver, Colo.-based gold producer warned of higher costs and swindling reserves from its older, more tapped-out mines. .
Red Hat Inc. reported a 59% increase in second-quarter profits, with sales of $127.3 million exceeding Wall Street forecasts of $125 million. Its shares climbed 4.8%.
Office Depot Inc. shares climbed 5.9% after J.P. Moran upgraded the stock to overweight from neutral, and downgraded Staples Inc. to underweight from neutral.
The broker also upgraded CVS Caremark Corp. to overweight from neutral and trimmed Walgreen Co. to neutral from overweight. CVS stock gained 0.9%, while gained 2%
Sprint Nextel Corp. edged up 1%. Goldman Sachs downgraded the telecommunications operator to neutral from buy.
Monsanto Co. shares hit an all-time high after a top executive predicted the biotechnology giant would triple its international acreage planted with genetically engineered seeds. Its shares were recently 2.5% ahead. .
Shares of CMGI Inc. fell 15% after the technology and venture capital firm reported a fourth-quarter loss of $6.2 million.
Among companies due to report Wednesday, Bed Bath & Beyond Inc. is expected to post earnings of 52 cents a share for the second quarter. Its stock climbed 1.3%.
In trading on the New York Mercantile Exchange, gold futures for December delivery fell $3.30 to close at $735.50 an ounce. .
The dollar took a breather from its recent drop, shrugging off grim durable goods data and gaining on its major counterparts. .
Treasurys fell, sending yields higher, with the benchmark 10-year note up 3/32 at 101 1/32, yielding 4.621%. .
Overseas, European markets advanced, bolstered by strength in the financial-services sector. .
In Asia, stocks were mixed, with Japan's Nikkei 225 benchmark closing marginally higher on gains by exporters.
By Kate Gibson