Stocks surged, then trimmed their gains Thursday as upbeat earnings news from tech bellwethers were offset by lingering uncertainty about the future of corporate profits amid flagging U.S. growth.

``The fundamental picture is still the same,'' said Paul Cherney, analyst at S&P Marketscope. ``We don't have tangible proof that the economy has bottomed and is now turning up.''

The Dow Jones industrial average gained 40.17 points to end the day at 10,610, after surging by more than 100 points in the morning. The technology-dominated Nasdaq Composite Index rose 30.40 points to 2,046.57, while the broader Standard & Poor's 500 Index rose 7.31 points to 1,215.02.

Dell Computer was among the marquee technology names bearing good news. Its shares rose $1.18 to $28.38 after saying its earnings and revenues would fall within its earlier guidance.

Nokia, whose U.S.-listed shares rose $2.51 to $19.51, posted earnings at the high end of expectations. The stock was among the most active on the New York Stock Exchange.

The Finland-based telecom equipment titan said it expects slightly lower third-quarter earnings per share but did not give a precise outlook for the fourth quarter. But Nokia officials said the company expects top-line revenue growth to return to its previous target of 25-35 percent next year.

Germany's SAP, Europe's biggest software maker, beat analysts' results forecasts. SAP rose $3.15 to $34.30 in U.S. trading.

Communications chip maker Broadcom Corp. jumped $4.16 to $43.16 after it reported a second-quarter loss before acquisition-related charges that was in line with diminished forecasts as sales fell 14 percent. 

Computing giant International Business Machines Corp. reported higher profits late on Wednesday but the world's largest computer maker said slack demand for computers and related goods could plague its results in the second half of the year. IBM's shares ticked modestly higher, up 6 cents to $104.34.

``The fact that the market did not sell off on IBM is an indication it is looking at the economic numbers as an indication economic recovery is in the making,'' said Peter Cardillo, director of research at Westfalia Investments.

On the economic front, the Labor Department said first-time claims for jobless benefits for the week ended July 14 fell to 414,000 from a revised 449,000 in the prior week. Economists had forecast 423,000 new filings vs. an initial reading of 445,000 in the prior week. 

A concurrent report from the U.S. Commerce Department showed the May trade deficit plummeted to $28.34 billion from a downward revised April reading of $31.99 billion. 

``I think these numbers are somewhat soothing,'' said Alan Ackerman, market strategist Fahnestock & Co. ``U.S. business has been penalized by the strength of the dollar to other currencies and the lower trade deficit is a good sign today. The fact the jobless claims fell is comforting also.'' 

The Conference Board said the June leading economic indicators rose 0.3 percent vs. economists' expectations of a rise of 0.2 percent. The data put the prior month's reading at a rise of 0.4 percent. 

Other earnings news or forecasts were mixed. 

Siebel Systems Inc., the world's largest seller of customer relationship management (CRM) software, lost 68 cents to $36.95 after it warned revenues would take a hit in the third and fourth quarters. 

Tobacco heavyweight Philip Morris Cos. Inc. posted a 5.4 percent rise in profits, but the maker of Marlboro cigarettes said it sees full-year underlying earnings growing at the low end of a range the company gave earlier this year. Its shares, one of the components that make up the Dow 30 index, rose 50 cents to $45.98. 

Occidental Petroleum Corp. rose 51 cents to $26.16 after its income rose a better-than-expected 36 percent as strong oil and gas prices helped offset weakness in its chemicals business.

Investors rewarded some companies that exceeded earnings estimates including Eli Lilly, up 71 cents at $77.46. 

Advancing issues outnumbered decliners nearly 3 to 2 on the New York Stock Exchange. Volume came to 1.34 billion shares, ahead of the 1.29 billion shares traded at the same point Wednesday. 

The Russell 2000 index, which tracks the performance of smaller company stocks, rose 3.92 to 487.54. 

Overseas markets were higher Thursday. Japan's Nikkei stock average finished the day with a slight gain, rising 0.1 percent. In Europe, Germany's DAX index and France's CAC-40 each advanced 1.3 percent, while Britain's FT-SE 100 gained 0.6 percent.

-- Reuters and the Associated Press contributed to this report.