Updated from 4:09 p.m. EDT

Buyers took their time getting started on Tuesday, but a late-session rally carried stocks to their best levels in more than a year after the major averages had drifted near the unchanged mark for much of the day.

The

Dow Jones Industrial Average

rose 107.45 points, or 1.1%, to 9523.27. The

Nasdaq

gained 31.03 points, or 1.7%, to 1841.48, and the

S&P 500

added 13.98 points, or 1.4%, to 1021.99. The Dow and the S&P closed at their best levels in almost 15 months, while the Nasdaq hit its highest point since April 2002.

Meanwhile, the 10-year Treasury note fell 1 12/32 to 96 30/32, yielding 4.64%.

In the last hour of trading, the market picked up steam as the indices neared key technical points. "We traded through psychologically important levels," said Ben Hovermale, a trader at Wells Capital Management.

Some experts said the major indices had been gearing up for Tuesday's gains. "The market, as measured by the S&P 500, has had a pretty good run for more than just today," said Brian Pears, a trader at Victory Capital Management. "I see this as a culmination of that trend."

Pears also said the late-day surge could have something to do with traders at mutual funds. "Oftentimes, when they have money to put to work, they will do it at the end of the day," he said.

Volume improved Tuesday. Approximately 1.44 billion shares changed hands on the

New York Stock Exchange

, while about 1.76 billion shares moved on the Nasdaq.

The Institute for Supply Management's manufacturing index came in at 54.7, as factory production rose to its highest level in more than three years. Economists were expecting the index to rise to 53.8 in August from 51.8 the previous month. Any level above 50 is consistent with expansion in the sector.

The employment component within the factory index remained weak, however. It fell to 45.9 in August from 46.1 in July, its 35th consecutive month of contraction. "That probably caused some nervousness," said Ray Hawkins, a trader at J.P Morgan. "But I think the path of least resistance is higher."

On a positive note, planned layoffs at U.S. firms decreased to 79,925 in August from 85,117 in July, according to Chicago outplacement firm Challenger, Gray & Christmas.

Among sectors, retail, utility, high-tech, pharmaceutical, banking and brokerage stocks were higher, while oil, semiconductor and gold issues were lower.

In corporate news,

Vivendi

(V) - Get Report

said that it is holding exclusive negotiations with

General Electric's

(GE) - Get Report

NBC to merge its entertainment assets, which include Universal Studios.

According to the proposed deal, NBC would control the new company, but Vivendi would retain a 20% stake. Vivendi rallied $1.35, or 8%, to $18.25, while GE advanced 87 cents, or 3%, to $30.44.

Tenet Healthcare

(THC) - Get Report

was also dealing, signing an agreement to sell four hospitals in Arkansas to

Triad Hospitals

(TRI) - Get Report

. Tenet expects to get about $175 million from the sale. The stock rose 14 cents to $16.19.

According to reports,

Boeing

(BA) - Get Report

has received an order for seven airplanes from

JAL

valued at about $850 million. Shares tacked on 30 cents to $37.69.

Two companies that have received a lot of bad press recently got a vote of confidence Tuesday from Merrill Lynch analysts. Merrill raised

Fannie Mae

(FNM)

and

Freddie Mac

(FRE)

to buy from hold, saying they're both cheap after all the bad news. Merrill said the "worst is over" for the mortgage finance companies. Fannie Mae increased $2.91, or 4.5%, to $67.70, while Freddie closed up 73 cents, or 1.4%, to $53.88.

Elsewhere, Smith Barney argued in a research note that

Wendy's

(WEN) - Get Report

could post higher same-store sales in August compared with a year earlier. It would be the first positive monthly comps this year for the fast-food chain, which Smith Barney raised to outperform. Shares of Wendy's tacked on $1.46, or 4.6%, at $33.01.

Separately, Smith Barney raised its price targets on several telecom-equipment stocks including

Cisco

(CSCO) - Get Report

,

Foundry

(FDRY)

and

Extreme Networks

(EXTR) - Get Report

.

Among other research actions, UBS said it remains optimistic on the homebuilders. The firm's top picks in the group are

Lennar

(LEN) - Get Report

,

Ryland

(RYL)

and

KB Home

(KBH) - Get Report

.

Meanwhile, Goldman Sachs offered positive comments on

Dell

(DELL) - Get Report

and

Seagate

(STX) - Get Report

, upgrading both to outperform from in-line. The firm also issued favorable research notes on the enterprise hardware sector and the software group. Dell rose 75 cents, or 2.3%, to $33.59, while Seagate added $1.54, or 6.7%, to $24.55.

Prudential Securities downgraded

International Paper

(IP) - Get Report

to sell from hold, saying that lower average selling prices, lower average volumes, inflation in energy and employee benefits, and cost penalties to Canadian factories presented almost a "perfect storm" of problems. Shares gained 34 cents, or 0.8%, to $40.89, however.

Separately, Prudential cut its rating on oil-service stocks

Schlumberger

(SLB) - Get Report

and

Baker Hughes

(BHI)

to hold from buy based on valuation concerns. Schlumberger finished lower 20 cents, or 0.4%, to $49.31, while Baker Hughes lost 43 cents, or 1.3%, to $33.03.

UBS Warburg raised its price target on

PetsMart

(PETM)

to $28 from $24, saying it is optimistic about the strategic direction of the company. The firm reiterated a buy rating. The stock closed up 2 cents to $23.99.

The dollar was slightly lower against the yen after Treasury Secretary John Snow indicated he wouldn't be pounding the table on exchange rates when he meets with officials in Japan and China during a trip this week. Snow said in Tokyo that he favors rates determined by a free market. The dollar was modestly higher against the euro.

European shares were mixed, with London's FTSE 100 up 0.1% to 4206 and Germany's Xetra DAX down 0.7% to 3546. In Asia, the Nikkei ended up 0.2% to 10,690, while the Hang Seng rose 0.3% to 10,939.