By Tomi Kilgore and Chris Dieterich 

Stocks advanced on Thursday after upbeat earnings from Apple and Facebook lifted technology shares.

The Dow Jones Industrial Average gained 33 points, or 0.2%, to 16534, putting the blue-chip benchmark within striking distance of its first record finish of 2014. On Wednesday, the Dow closed 0.5% below its Dec. 31 record closing high of 16576.66.

The S&P 500 tacked on seven points, or 0.4%, to 1882, rising for the seventh time in eight sessions. The tech-oriented Nasdaq Composite Index rallied 38 points, or 0.9%, to 4165.

Apple, the biggest U.S. company by stock-market value, shot up 7.9% after the company late Wednesday reported better-than-expected fiscal second-quarter earnings and revenue, increased its stock-buyback program, raised its dividend and announced a seven-for-one stock split.

Apple's report helped to soothe investors who have been hit hard in recent weeks by declines in fast-moving tech and biotechnology stocks. The Nasdaq finished Wednesday with a 2.4% loss over the past month.

Apple's report "certainly helps bring people back to the tech sector," said Robert Pavlik, chief market strategist at Banyan Partners, which oversees $4.5 billion in assets. It "refocuses them on the fact that there is still value to be had there," he said.

Facebook advanced 2.1% after the social network late Wednesday topped first-quarter earnings and revenue forecasts, as the company continued to capitalize on its users' shift to mobile devices.

Caterpillar led the Dow, up 3.6%, after exceeding earnings and revenue estimates.

With 39% of the S&P 500 having reported first-quarter results through early Thursday morning, overall earnings per share are now seen rising 0.4% from year-ago levels, according to FactSet, compared with expectations of a 1.4% decline when earnings season started a little over two weeks ago.

Deal news in the health-care sector also boosted sentiment. Zimmer Holdings surged 18% after the company said it agreed to buy privately held orthopedic-device maker Biomet Inc. for about $13.35 billion in cash and stock.

Earlier in the week, William Ackman's Pershing Square Capital Management and Valeant Pharmaceuticals disclosed an offer to buy Botox maker Allergan, and GlaxoSmithKline and Novartis announced a series of transactions, including Novartis' $14.5 billion purchase of GlaxoSmithKline's oncology unit.

Investors Thursday digested mixed readings on the U.S. economy. Initial claims for jobless benefits rose 24,000 to 329,000 in the latest week, versus expectations of 315,000. Separately, durable-goods orders increased 2.6% in March, the biggest gain in four months, exceeding forecasts of a 2% rise.

Thursday's durable-goods report provided the latest evidence that a series of weak economic reports in the first quarter "was indeed weather related," said Dan Greenhaus, chief strategist at BTIG.

The yield on the 10-year Treasury note ticked up to 2.715% from 2.686% late Wednesday.

Crude-oil futures added 0.7% to $102.13 a barrel, after suffering the biggest two-day decline in six weeks through Wednesday. Gold futures fell 0.7% to $1275.90 a troy ounce. The dollar edged higher against the euro and the yen.

The Stoxx Europe 600 rose 0.4%, as upbeat economic data out of Germany and hopes for further central-bank stimulus provided a boost. The German Ifo business sentiment index for April rose to 107.3 from 106.4 in March, topping forecasts of 105.9.

European Central Bank President Mario Draghi said Thursday the ECB may consider broad-based asset purchases if consumer inflation remains too low.

Asian markets were mostly lower, with China's Shanghai Composite falling 0.5%, the fifth loss in six sessions, and Japan's Nikkei Stock Average shedding 1%.

In other corporate news, 3M slipped 1.1% after results came up a bit shy of forecasts.

Qualcomm slumped 3.6% after better-than-expected fiscal second-quarter earnings were overshadowed by disappointing revenue and a downbeat current-quarter earnings outlook.

General Motors gained 3.1% after reporting much better-than-expected first-quarter earnings, while United Parcel Service lost 1.7% after missing earnings estimates.

Microsoft, which reports results after Thursday's close, tacked on 0.3%.

Write to Tomi Kilgore at tomi.kilgore@wsj.com

Allergan (NYSE:AGN)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Allergan Charts.
Allergan (NYSE:AGN)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Allergan Charts.