NEW YORK - The stock market closed mostly higher Thursday, helped by positive earnings out of several large U.S. companies including Apple and construction equipment maker Caterpillar.

The gains were modest, however, as investors turned their eyes back to Russia and Ukraine, where geopolitical tensions were heating up once again. Some earnings reports, such as those from 3M and Facebook, also failed to impress investors.

It was the seventh time in the last eight days that the S&P 500 has closed higher. Despite the recent momentum, traders remain nervous.

The Standard & Poor's 500 index rose 3.22 points, or 0.17 percent, to 1,878.61 and the Nasdaq composite rose 21.37 points, or 0.52 percent, to 4,148.34.

The Dow Jones industrial average closed at 16,501.65, unchanged on the day. The last time the Dow closed flat was Dec. 24, 2001.

Apple was among the biggest gainers in the S&P 500 and helped push the Nasdaq composite up more than the rest of the broader market.

Apple rose $43.02, or 8 percent, to $567.77 after the California-based company reported a profit of $11.62 a share, beating forecasts. Apple also announced it would increase its share buyback program from $60 billion to $90 billion, raise its quarterly dividend, and split its stock seven-for-one.

Dow member Caterpillar rose $1.90, or 2 percent, to $105.28. The construction equipment manufacturer said its quarterly earnings rose 5 percent from a year ago. Caterpillar also raised is 2014 profit forecast. The company earned an adjusted profit of $1.61 a share, well ahead of the $1.21 per share expected by analysts.

Another Dow member, 3M, wasn't as fortunate in the first quarter as Caterpillar was.

The maker of industrial coatings and Post-it notes fell $1.34, or 1 percent, to $136.65 after the company's results missed analysts' expectations. The Minnesota-based conglomerate earned $1.79 a share, a penny shy of forecasts. Revenue also came in short of expectations.

The yield on 10-year U.S. Treasury note fell to 2.68 percent as bond prices rose. Gold rose $6, or 0.5 percent, to $1,290.60 an ounce.

Orders to U.S. factories for long-lasting manufactured goods rose 2.6 percent, adding to the 2.1 percent rise in February. The back-to-back gains followed two big declines in December and January, which had raised concerns about possible weakness in manufacturing. The earlier declines, however, were likely tied to bad winter weather.

On the jobs front, the number of people seeking U.S. unemployment benefits jumped 24,000 to a seasonally adjusted 329,000 last week, though the gain likely reflected temporary layoffs in the week before Easter.

In other company news:

Facebook fell 49 cents, or almost 1 percent, to $60.87, despite reporting profit and sales that handily beat forecasts. The social-media giant earned an adjusted profit of 34 cents a share compared with analysts' estimates of 24 cents a share.

Microsoft rose 99 cents, or 2.5 percent, to $40.90 in after-hours trading, after reporting a profit that beat analysts' expectations. The software giant earned 68 cents a share, compared with the 63 cents analysts were looking for.

Amazon rose $9.04, or 2.7 percent, to $346.00 in after-market hours. The online retail giant posted a profit of 23 cents a share, 2 cents better than analysts' expectations.

Zimmer Holdings soared $10.52, or 12 percent, to $101.97 after announcing it would buy the privately held orthopedic device company Biomet for $13.35 billion in cash and stock. Biomet was taken private in 2007 by a group of private equity companies, and was looking to go public later this year.