Updated from 4:06 p.m. EDT

Stocks ended with gains on Thursday, following news that House and Senate negotiators had approved a $318 billion tax-relief measure.

Solidly in the green for most of the day, the Dow Jones Industrial Average ended up 77.59 points, or 0.9%, at 8594.02, while the Nasdaq rose 17.68 points, or 1.2%, to 1507.55. The S&P 500 gained 8.45 points, or 0.9%, to 931.87.

Negotiators from both chambers of Congress said Wednesday night that they had the votes to pass the tax-cut measure, which would temporarily lower levies on dividends and capital gains. While the bill was largely expected and wasn't as strong as what the Bush administration had proposed, markets applauded the news.

"After three long years with the bear, relative to other vehicles, stocks are looking attractive, which is the hang-tough mentality markets have had lately," said Bryan Piskorowski, equity analyst at Prudential Securities. "Volume has been decent and breadth is good, too. The rising tide is supporting more boats, but we're going to need to see some better economic data to boost us a lot higher from where we are."

Markets also retained a little optimism created Wednesday when Federal Reserve chief Alan Greenspan said the risk of deflation is small, even though the central bank might need to adopt measures to prevent it. Greenspan also said the economy is set to accelerate, although he refrained from predicting when.

But one economic gauge remains worrisome: the labor market. Jobless claims for the week ended May 22 rose to 428,000, above 417,000 a week earlier. This marks the 14th straight week the measure has topped 400,000.

On the corporate front, Aetna ( AET) agreed on a settlement in a class-action lawsuit filed by U.S. doctors who claimed the company had unjustly cut reimbursements and interfered with treatment.

Prudential told investors that Aetna's news bodes well for the rest of the HMO industry, saying damages appear reasonable. Despite the positive comments, shares of Aetna were down 34 cents, or 0.6%, to $56.90, while the Morgan Stanley HMO Index was up 0.3%.

Altria ( MO) was a big boost for the Dow, gaining $2.75, or 7.2%, to $41.05 after CSFB upgraded the tobacco maker to outperform from neutral, telling investors that litigation against tobacco companies will wane over the next year or so.

Ciena ( CIEN), an optical-gear maker, said its loss narrowed in the fiscal second quarter, although sales fell due to lower spending among its customers. Ciena was down 41 cents, or 7.6%, to $4.97.

Elsewhere in tech, a South China Morning Post article said that China Unicom would halt its planned trial of Qualcomm's ( QCOM) GSM 1X high-speed data transmission chip because of the SARS virus. Qualcomm was down 3 cents, or 0.1%, to $26.50.

Synopsys ( SNPS), a maker of integrated circuit design software, was up $8.03, or 15.8%, to $58.93 one day after posting higher quarterly earnings amid stronger demand for its products. Synopsys also forecast higher-than-expected profit for the current quarter.

Telecom-equipment maker ADC ( ADCT) said Wednesday after the close that it narrowed its quarterly loss by controlling costs, but that sales fell 36%. The company now predicts fiscal third-quarter revenue will be weaker than Wall Street had expected. Shares were off 20 cents, or 0.9%, to $2.85.

In retail news, Williams-Sonoma ( WSM) reported a drop in first-quarter profit amid higher costs and weaker demand for high-end products, but beat previously reduced estimates. Claire's Stores ( CLE) announced first-quarter earnings that beat estimates on a 17% revenue increase over the year-ago quarter. Williams-Sonoma fell 3 cents, or 0.1%, to $26.50, while Claire's Stores was up $1.83, or 6.8%, to $28.69.

Elsewhere in the space, Foot Locker ( FL) matched Wall Street expectations for the first quarter and reiterated guidance for the second quarter. Its shares gained $1.12, or 9.9%, to $12.49. Meanwhile, Barnes & Noble ( BKS) was up 45 cents, or 2.2%, to $20.65 after the company widened its loss but beat analysts' expectations.

GameStop ( GME), which Barnes & Noble owns a stake in, was down 79 cents, or 6.4%, to $11.56 after the company warned that second-quarter same-store sales would be down between 6% and 12%. Southwest Securities downgraded GameStop and rival Electronics Boutique ( ELBO) to neutral from strong buy. Electronics Boutique was down 93 cents, or 4.8%, to $18.30.

In the airline sector, JetBlue Airways ( JBLU) was up $1.51, or 4.7%, to $33.59 after UBS Warburg upgraded it to neutral from reduce. Atlantic Coast Air ( ACAI) was up 27 cents, or 2.8%, to $9.87 after BB&T upgraded it to buy from hold.

Despite fears of mad-cow disease in Canada and a weak earnings outlook, Sonic ( SONC) shares were up 52 cents, or 2.1%, to $25.09. Earlier in the day, the company said third-quarter earnings would meet expectations, but that same-store sales would be at the low end of current estimates.

ImClone ( IMCLE) received authorization to continue being listed on the Nasdaq Stock Market, as long as it meets deadlines for filing regulatory reports and updating estimates. Shares were up 57 cents, or 3.1%, to $18.92.

Treasuries were higher, with the yield on the 10-year note down 6 basis points at 3.34%. Crude oil prices were lower. The dollar was stronger against the yen and euro.

Overseas markets were higher, with London's FTSE 100 ending up 1.4% at 3990 and Germany's Xetra DAX closing up 1.3% at 2865. In Asia, Japan's Nikkei closed 0.4% higher at 8051, while Hong Kong's Hang Seng gained 0.8% to 9131.

On Wednesday, the Dow closed up 25 points, or 0.3%, at 8516. The S&P 500 gained almost 4 points, or 0.4%, to 923, while the Nasdaq lost 1 point, or 0.1%, to 1489.

As originally published, this story contained an error. Please see Corrections and Clarifications.

More from Markets

Cryptocurrencies Could 'Bring the Internet to a Halt', Central Bank Agency Warns

Cryptocurrencies Could 'Bring the Internet to a Halt', Central Bank Agency Warns

Volkswagen's Audi CEO Arrested in Diesel Emissions Probe

Volkswagen's Audi CEO Arrested in Diesel Emissions Probe

China Trade War, Google, JD.com, Tesla, Brooks Koepka - 5 Things You Must Know

China Trade War, Google, JD.com, Tesla, Brooks Koepka - 5 Things You Must Know

Global Stocks Retreat as U.S.-China Trade War Intensifies

Global Stocks Retreat as U.S.-China Trade War Intensifies

Billionaire Investor Tim Draper Explains Why Bitcoin Will Hit $250,000 in 2022

Billionaire Investor Tim Draper Explains Why Bitcoin Will Hit $250,000 in 2022