Updated from 4:04 p.m. EST

Stocks ended higher Tuesday, with late-day buying lifting the

Nasdaq

out of the red and handing the

Dow

a triple-digit gain. Still, trade was generally uninspiring, as investors awaited the outcome of the Congressional elections and the Federal Reserve policy meeting on Wednesday.

The Dow Jones Industrial Average closed up 106 points, or 1.2%, at 8678, while the Nasdaq gained 4.7 points, or 0.3%, to 1401. The

S&P 500

rose 7.05 points, or 0.8%, to 915. Volume on the Nasdaq was 1.7 billion shares, while volume on the Big Board was 1.3 billion shares.

Adding to the Dow's gains Tuesday were shares of

Boeing

(BA) - Get Report

,

Home Depot

(HD) - Get Report

and

Exxon Mobil

(XOM) - Get Report

. Boeing jumped 6% to $31.52 on news that it is close to a deal to lease modified 767 jetliners to the U.S. Air Force for $17 billion. Defense stocks generally sold off Monday despite overall strength in the market.

On the Nasdaq, Internet and biotech shares helped overcome weakness in chip and hardware stocks. Still, the Nasdaq registered only slight gains after climbing 5% over the last two sessions.

"The Nasdaq had a nice move in the last two days, so I think at this point we're seeing more of a flight to quality, especially going into the uncertainty of the election and Fed," said Louis Parks, senior managing director at Raymond James.

Analysts said many investors were inactive Tuesday ahead of the midterm elections and the central bank's decision on interest rates Wednesday.

The Fed is expected to cut rates by another 25 basis points from already historically low levels. Analysts say the move could be a nonevent for the market unless the Fed chooses to cut rates by 50 basis points or leaves rates on hold at 1.75%.

If rates are slashed by more than the projected amount, analysts say investors could be disappointed because it would signal that the Fed is worried about the economy slipping into recession. But no cut could spark concern that the Fed isn't doing enough to stem the weakness.

Meanwhile, control of the House and Senate hangs in the balance, as a handful key races from Minnesota to Tennessee remain too close to call. All 435 House seats are up for grabs, as are 34 Senate seats.

Many traders said they would prefer to see a Republican sweep, noting that the GOP would make permanent its tax cut plans announced last year. A Republican government is also seen as friendlier to big business. But others note that this is precisely the wrong time to give many scandal-ridden businesses free reign.

"I think the market's on hold to see what the Fed reaction is as well the results of the election this evening," said Parks.

Although defense, retail and drug shares advanced Tuesday, other sectors struggled. Semiconductors slumped more than 2%, pulled down by a 3.6% decline in shares of

Applied Materials

(AMAT) - Get Report

, which said it would cut 11% of its staff amid persistent weakness in the chip business. Hardware issues were also lower, with

Hewlett Packard

(HPQ) - Get Report

and

IBM

(IBM) - Get Report

weighing on the Dow.

A slew of downgrades also added to the cautious tone. First Albany cut

Yahoo!

(YHOO)

to buy and

Internet Security

( ISSX) to neutral, while Bear Stearns dropped

Nextel

( NXTL) to peer perform from outperform, citing valuation concerns. Dow component

American Express

(AXP) - Get Report

tumbled more than 2% to $36.60 after Merrill Lynch cut the stock to "neutral," citing the recent run-up.

Corporate earnings also remained a factor Tuesday. Troubled insurer

HealthSouth

(HRC) - Get Report

posted a wide third-quarter earnings miss, citing changes in Medicare reimbursement rules. Elsewhere, drug wholesaler

AmerisourceBergen

(ABC) - Get Report

said its third-quarter earnings nearly tripled, beating the consensus by about 3 cents a share. Healthcare product maker

Henry Schein

(HSIC) - Get Report

also blew past expectations, earning 85 cents a share before a gain, compared with the consensus estimate of 72 cents.

In merger and acquisition news,

State Street

(STT) - Get Report

agreed to buy "substantial parts" of

Deutsche Bank's

(DB) - Get Report

global securities services business for $1.5 billion. State Street was up 3 cents to $43.60 and Deutsche Bank was up $3.18 to $49.77.

On the economic front, the National Association of Purchasing Managers' nonmanufacturing index came in at 53.1 in October, down from 53.9 in September but better than economists' forecasts for a reading of 52. The data showed that while the services sector is continuing to expand, it is doing so at a slower pace.

On Monday, tech shares led the market higher, with the Nasdaq gaining 2.6% to 1396 while the Dow added 0.6% to 8571. Stocks were boosted by a favorable court ruling for

Microsoft

(MSFT) - Get Report

in its antitrust proceeding with the government. Microsoft was up 52 cents to $56.38 after climbing 5.5% on Monday.

Still, stocks ended well off their best levels for the day as uncertainty over the national elections and the Fed meeting gave investors an excuse to take profits off the table. Comments from Defense Secretary Donald Rumsfeld added to the selloff after he warned that the U.S. could soon call up reserves for a possible war with Iraq.

Overseas markets ended generally higher, with London's FTSE 100 up 0.11% to 4146 and Germany's Xetra DAX up 0.70% at 3351. In Japan, the Nikkei added 2.9% to 8938, while Hong Kong's Hang Seng fell 0.7% to 9655.