The markets gains were modest, however, as investors turned their eyes back to Russia and Ukraine, where geopolitical tensions were heating up once on escalating violence between the two countries. Some earnings reports, such as 3M (MMM) and Facebook (FB), 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 upward momentum, traders remain nervous.
"Everyone is a little apprehensive as we move higher, waiting for the next shoe to drop that's going to make the market head lower," said Jonathan Corpina, a floor trader at the New York Stock Exchange with Meridian Equity Partners. "The market isn't in a healthy mentality at the moment."
The Standard & Poor's 500 index rose 3.22 points, or 0.2 percent, to close at 1,878.61 and the Nasdaq composite rose 21.37 points, or 0.5 percent, ending at 4,148.34. The Dow Jones industrial average closed at 16,501.65, unchanged on the day.
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 late Wednesday of $10.2 billion, or $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.
Despite the mostly positive news from U.S. companies, overseas worries put a damper on the market.
Russian officials said they would hold new military exercises along the Ukrainian border, hours after Ukrainian troops killed at least two pro-Russia insurgents in eastern Ukraine. Russian President Vladimir Putin described the Ukrainian attack as a "punitive operation" and threatened Kiev with unspecified consequences. The Russia-Ukraine conflict has been relatively quiet for the last couple of weeks, so the recent increase in tensions has made some investors nervous.
Tom di Galoma, who runs fixed-income trading for ED&F Man Capital, said the Ukraine-Russia conflict was sending some investors into safer assets, such as U.S. Treasurys and gold.
The yield on 10-year U.S. Treasury note fell 2.68 percent as bond prices rose. Gold rose $6, or 0.5 percent, to $1.290.60 an ounce.
"One day we think there's a resolution, and the next the situation out of Ukraine and Russia turns a little alarming," Corpina said.
Investors were also working through another batch of economic reports. 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 1 percent, to $60.87, despite reporting profit and sales that handedly beat forecasts. The social media giant earned an adjusted profit of 34 cents a share compared to analysts' estimates of 24 cents a share.
- Microsoft (MSFT) rose 99 cents, or 2.5 percent, to $40.90 in afterhours 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 (AMZN) rose $9.04, or 2.7 percent, to $346.00 in aftermarket hours. The online retail giant posted a profit of 23 cents a share, two cents better than analysts' expectations.
- Zimmer Holdings (ZMH) 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.