After falling more than 50 points in early trading, the Nasdaq composite index closed up 44.38 at 3,893.89. The Standard & Poor's 500 index, initially down about 10 points, also closed higher by 2.92 at 1,484.91.
The Dow Jones industrial average started down and stayed down all day. The index fell 51.05 to close at 11,182.18 led by Intel and by Hewlett-Packard, which lost $6 to $105.
Also dragging down the Dow Jones: Financial-service giant Chase Manhattan slumped in the wake of its announcement to buy J.P. Morgan.
Chase announced today it would acquire J.P. Morgan for $35.6 billion in stock, uniting two of the oldest U.S. banks. The new company, to be called J.P. Morgan Chase, expects to boost profit as a one-stop source for financial services to businesses and moneyed investors worldwide.
Analysts fretted that Chase would not be able to produce cost savings and additional profit in the near term. Chase shares dropped $2.13, or 4.02 percent, to $50.69 on the New York Stock Exchange, while J.P. Morgan shares dropped $4, or 2.16 percent, to $181.50.
The tech gains came despite stumbles from some of the new economy's biggest names. Banc of America Securities downgraded Intel and Advanced Micro Devices to "market perform" from "strong buy" and also cut earnings estimates on the chipmakers. AMD fell $1.88 to $28.63, and Intel dropped $3.69 to $61.25.
Despite the downgrades, chip stocks made some gains. The Philadelphia semiconductor index climbed 18.03, or nearly 2 percent, to 1,006.88 led by chip-set designer Rambus, which rose $7.66 to $84.47.
Large-cap tech stocks helped push the markets into the green. At the end of regular trading, Cisco Systems rose $2.44 to $61.31, Oracle gained $2.44 to $81.81, and Sun Microsystems climbed $3.88 to $118.19. Microsoft rose 13 cents to $68.25.
SCI Systems, the world's second-biggest contract manufacturer of electronics, said fiscal first-quarter profit would miss estimates because sales fell and the company couldn't get parts on time. The company's shares fell $9.94, or almost 18 percent, to $46.
Several experts blamed the jittery market on lowered earnings estimates. As companies prepare to announce third-quarter results in late September and early October, many executives have been forced to warn analysts and investors that their expectations are too high.
The markets "just continue to get this parade of pre-announcements which doesn't urge people to bid stocks higher," said Todd Clark, head of listed trading at WR Hambrecht.
Hotly debated economic data also contributed to investors' jitters.
The Commerce Department announced today that America's trade deficit climbed to a record $106.1 billion in the second quarter, up 4.6 percent from the previous quarter, as U.S. consumers bought more from abroad than American exporters were able to sell.
The deficit could be perceived as positive or negative for the general economy and stock markets, analysts said.
On the one hand, the Commerce Department announcement confirms the health and unflagging consumer confidence of the U.S. economy.
"It's a natural implication of the strength of the economy," said Paul Christopher, an economist at A.G. Edwards. "With the U.S. economy growing as it is, (consumers) have the opportunity to buy goods at low prices, and foreigners are only too willing to loan us the money to do that."
On the other hand, Federal Reserve Chairman Alan Greenspan and others have voiced concern that the deficit, which includes the increasing amount of money foreigners invest in the U.S. stock market, could eventually result in a backlash that sends foreign investment back to native markets. That could put pressure on the relative value of the U.S. dollar and even ignite domestic inflation.
Because of that concern, experts say, the difference between what the country sells and spends at home and abroad cannot go on indefinitely.
"The gap can't last forever," said Peter Kretzmer, an economist at Banc of America Securities. "At some point the money borrowed has to be paid back."
The CNET tech index gained 28.86 to close at 3,090.46. Winners overtook losers, with 69 of the 97 stocks in the index rising and 28 falling.
Of the 18 sectors tracked by CNET Investor, network equipment makers posted the sharpest gains, rising about 5 percent. PC hardware makers were the day's largest losers, falling nearly 2 percent.
Shares of Inktomi, an Internet infrastructure company, slipped $2.25 to $108.75. Inktomi said it will acquire FastForward Networks, a maker of Internet broadcasting technology, in a stock deal valued at $1.3 billion.