Updated from 4:04 p.m. EDT

Stocks closed with modest gains Friday to end a painful week, after a strong earnings report from General Electric ( GE) and upbeat words from its chief executive sparked an early rally that was held in check by high oil prices and the threat of global terrorism.

The Dow added 41.66 points, or 0.41%, to 10,213.22; the S&P 500 rose 3.70 points, or 0.33%, to 1112.81; and the Nasdaq tacked on 11.01 points, or 0.57%, to 1946.33. In the credit markets, the 10-year Treasury was trading up 2/32 in price, yielding 4.46%.

In light trading ahead of the weekend, volume approached 1.2 billion shares on the New York Stock Exchange, where advancers outnumbered decliners by about 2 to 1. On the Nasdaq, nearly 1.4 billion shares changed hands and advancers held about a 11-to-8 majority.

"I think investors are getting worn out from all the faded rallies," said David Briggs. "There seems to be an incredible lack of interest in the market, and when you've got Tom Ridge on TV talking about large-scale terrorist attacks prior to an election, I think basically you're seeing a buyer's strike."

Briggs said the terrorism talk would not be such a negative factor in financial markets if investors saw opportunities in the market. "People are struggling with valuations now, and there's just no leadership out there to get a rally started," he said. "These warnings are another stick on the fire that says the market is fair-valued at best in here. It's certainly not cheap."

Homeland Security Secretary Tom Ridge added to jitters Thursday by saying American intelligence analysts have credible information that al Qaeda terrorists are planning another attack in the U.S. He had no specifics and said there was no reason to raise the terrorist threat level for now, but The New York Times reported Friday morning that, according to senior Bush administration officials, "Osama bin Laden and his chief lieutenants, operating from hideouts suspected to be along the Afghanistan-Pakistan border, are directing an al Qaeda effort to launch an attack in the United States sometime this year."

Also on the geopolitical front, the legitimacy of the U.S.-led occupation of Iraq suffered another blow when key assertions that led to the 2003 invasion of the country were stated to be false or exaggerated in a Senate Intelligence Committee report released Friday. The report states that previous allegations that Saddam Hussein's regime had chemical and biological weapons and could make a nuclear weapon by the end of the decade were wrong.

In other markets, the dollar was down against the Japanese yen and the euro. Oil prices ended just below $40 a barrel Friday, but traders remained worried about short-term supplies and the possibility of terror attacks on the U.S. in the near future. The benchmark U.S. crude lost 37 cents, or 0.9%, to $39.96, having closed at a one-month high Thursday.

Friday's gains did little to block the hemorrhaging caused by a recent selloff that has governed four out of the last six sessions. During that time, investors have been hit by more than a dozen marquee earnings warnings from the tech sector that sent the Goldman Sachs Technology Industry Software Index to its lowest level in a year.

Overall, the week's bloodletting took the Dow down more than 0.6%, extending its losing streak to three weeks. The S&P embarked on a four-week losing streak, down 1% this week, and the stumbling Nasdaq lost for the second week in a row, down almost 3%.

"The internals of the Nasdaq have weakened quite a bit of late," said Mark Arbeter, chief technical analyst with Standard & Poor's. "The latest market action has been disappointing and raises the possibility that the lows posted in May will be taken out."

The corporate story of the day was General Electric reporting second-quarter profits of 38 cents a share, the same as last year's performance and a penny better than the consensus estimate. The conglomerate also raised full-year guidance a hair to $1.55 to $1.60 a share. Shares closed up 46 cents, or 1.4%, to $32.16.

GE's chief executive, Jeffrey Immelt, said "the best economy we've seen in years" led to orders for goods such as plastics and jet-engine parts.

"This offsets some of the gloom that's been going around," said Larry Wachtel, senior market analyst at Wachovia Securities. "We've gotten beat up for three days, and now it's time for a lift. The question now is what do we do beyond noon today going into a terrorist-alert weekend?"

Elsewhere, Abbott Labs ( ABT) also delivered earnings, as expected, of 54 cents a share for its second quarter, up from 47 cents in the year-ago period, but offered third-quarter guidance slightly below analysts' consensus forecast. The company also said it will file a new drug application for its prostate cancer treatment. Shares closed down 38 cents, or 0.9%, to $39.90.

In the tech space, SAP ( SAP) issued one of the few positive outlooks for second-quarter earnings from the embattled software sector. The German company said revenue will grow by 9% for the quarter, beating Wall Street's estimates. The stock closed up $2.08, or 5.5%, to $40.04.

Computer Associates ( CA) could be under pressure after saying late Thursday that its third-quarter earnings would come in lower than expectations due to weaknesses in its services business. Its shares closed up $1.27, or 5.2%, to $25.81.

On the economic front, the government said that wholesale inventories increased by 1.2% in May, blowing away Wall Street's consensus estimate of 0.5% growth. Also, April's figure was revised to a rise of 0.2% from the previously reported drop of 0.1%.

Overseas markets closed mixed. In Japan, the Nikkei closed up 0.9% at 11,423, and Hong Kong's Hang Seng added 2.2% to 12,202. In Europe, London's FTSE 100 gained 0.3% to 4393, while Germany's Xetra DAX shed 0.2% to 3924.

Before Monday's opening bell, Sun Trust Banks ( STI) is expected to report second-quarter profits of $1.26 a share, up from last year's $1.17 a share.

Quarterly reports will continue to trickle in next week as earnings season ramps up in earnest. Notables during the week include Johnson & Johnson ( JNJ); Intel ( INTC); AMD ( AMD); Citigroup ( C); and IBM ( IBM).