Updated from 4:08 p.m. EDT

Stocks were under pressure for much of the session Tuesday, but the major averages reversed ground late in the day and closed higher.

The

Dow Jones Industrial Average

ended up 22.81 points, or 0.2%, to 9340.45, while the

Nasdaq

rose 6.34 points, or 0.4%, to 1770.65. The

S&P 500

advanced 3.02 points, or 0.3%, to 996.73.

The Dow went as low as 9233 earlier, while the Nasdaq touched 1737.

"All that happened is you got a few buyers, and the sellers stepped away," said Peter Blatchford, a trader at Miller Tabak. "On a day like today, that is all it takes."

In the final hours, investors bid up pharmaceutical, banking, high-tech and oil stocks. Retailers remained higher after

Target

(TGT) - Get Report

said sales were above plan for the week ended Aug. 23. On Monday,

Wal-Mart

(WMT) - Get Report

raised its same-store sales guidance.

Trading volume was well below average levels so far this year. About 1.2 billion shares moved on the

New York Stock Exchange

, while 1.36 billion shares traded on the Nasdaq.

Some experts attributed the late-day rally to short-covering. "The shorts got nervous," said Mike Driscoll, a trader at Bear Stearns. "Tuesday's session was very much dominated by trading-type activity."

Dick Dickson, a technical analyst at Lowry Research, expects the market to get a lift after Labor Day, but he has some concerns. "Our big worry right now is that volume won't pick up substantially on the rally," he said. "That could leave the market in a very vulnerable position."

Intel

(INTC) - Get Report

remained in the headlines on Tuesday. The chipmaker raised revenue and margin guidance last week, but for consecutive days CEO Craig Barrett has tried to curb the optimism in overseas interviews.

In the latest quoted by

Reuters

, Barrett said it's possible the recent uptick in personal computer demand is temporary, and he repeated that it's too early to call a full-fledged tech rebound. Shares rebounded at the end of the day, rising 50 cents, or 1.84%, to $27.71, while chip-equipment maker

Applied Materials

(AMAT) - Get Report

lost 21 cents, or 1%, to $20.95.

Meanwhile, the market got some benign data on the economy. A report on July durable-goods orders met expectations. Orders rose 1% last month, in line with economists' estimates. Excluding transportation equipment, orders were much stronger than expected, climbing 1.7%.

Separately, consumer confidence rose in August after falling in July. The Conference Board said its index advanced to 81.3 in August from a revised 77 in July, as the six-month outlook improved markedly.

Reaction to the report was mixed. The expectations index jumped to 94.4 from 86.3. Assessments of current conditions weren't as rosy, however. The present situation index dropped to 61.6 from 63, its fourth decline in a row. Meanwhile, the "jobs hard to get" index rose to a 10-year high of 34.1.

New-home sales fell in July from record levels, but were still ahead of economists' expectations. Sales dipped to a seasonally adjusted 1.165 million in from an upwardly revised 1.2 million pace in June. Separately, weekly chain-store sales edged higher as a result of federal tax cuts.

Among technology stocks,

Cisco

(CSCO) - Get Report

added 7 cents, or 0.4%, to $19.10,

Taiwan Semiconductor

(TSM) - Get Report

gained a penny, or 0.1%, to $11.46, and

TheStreet Recommends

Nokia

(NOK) - Get Report

rose 35 cents, or 2.3%, to $15.79.

Another tech company,

Computer Associates

(CA) - Get Report

, said Monday night that it reached a settlement with shareholders who sued it over accounting practices. The software giant will issue 5.7 million shares to the plaintiffs and take a $97 million charge.

Toll Brothers

(TOL) - Get Report

is the latest homebuilder to announce a solid quarter. The luxury builder said it earned $68 million, or 90 cents a share, in the latest quarter, up from $54 million, or 70 cents a share, last year. Revenue rose 19%. Shares closed down 12 cents, or 0.4%, to $29.50.

In analyst actions, telecom-equipment maker

Ciena

(CIEN) - Get Report

was upgraded at UBS to neutral from reduce on the expectation that new contracts could boost its revenue. Ciena gained 32 cents, or 5.5%, at $6.18.

Elsewhere,

Xerox

(XRX) - Get Report

rose 85 cents, or 8.9%, to $10.39 after SG Cowen upgraded the stock to strong buy from market perform, saying that shares have significant upside.

Biotech firm

Geron

(GERN) - Get Report

finished ahead by 55 cents, or 7.4%, to $7.94 after the company said it received a patent that triggers a milestone payment from a licensee of its technology.

Generic drugmaker

Andrx

(ADRX)

rose 89 cents, or 5.2%, to $18.21 after it got tentative approval to sell a version of

Pfizer's

(PFE) - Get Report

diabetes treatment Glucotrol, although patent litigation over the drug continues.

Software manufacturer

Siebel Systems

(SEBL)

dropped 24 cents, or 2.4%, to $9.87 after indicated it continues to see pricing pressure in its customer relationship management market. The company separately settled a shareholder lawsuit related to its stock option grants, and said that it would provide more information about compensation.

Medical device maker

Guidant

(GDT)

gained $1.73, or 3.6%, to $49.60 after it affirmed earnings and sales estimates for the third quarter.

Shares of

Kraft

(KFT)

fell 25 cents, or 0.9%, to $29.07 after the foodmaker raised its dividend by 20%. The company will now have an 18-cent quarterly payout.

Treasuries were lower, with the yield on the 10-year note at 4.48%. Crude oil prices for future delivery rose in London. The dollar strengthened against the yen and the euro.

London's FTSE 100 was down 1.1% at 4177, and Germany's Xetra DAX was off 1.4% at 3452. In Asia, Japan's Nikkei moved up 0.5% to 10,332, and Hong Kong's Hang Seng fell 0.1% to 10,753.

Stocks had a flat-to-lower session Monday, with the Dow shedding 31 points, or 0.3%, to 9317. The Nasdaq lost 1 point, or 0.1%, to 1764, while the S&P 500 rose less than a point, or 0.1%, to almost 994.