Wall Street closed lower on Wednesday after Apple Inc. (Nasdaq: AAPL) announced that its second-quarter earnings had soared more than 5 percent and as investors weighed a series of earnings reports from Caterpillar Inc. (NYSE: CAT), Ford Motor Company (NYSE: F), The Boeing Company (NYSE: BA) and PepsiCo, Inc. (NYSE: PEP).

Shares of Apple Inc. rallied more than 5 percent in afternoon trading after the tech giant reported better-than-expected earnings after the bell on Tuesday. Apple reported a profit of $7.47 a share on revenue of $35.3 billion, beating forecasts for $7.32 a share on sales of $35.02 billion. The iPhone maker also saw a boost in iPhone sales to 31.2 million.

Although Apple's iPhone sales jumped, the company saw a decline in China as sales in the region fell nearly 19 percent from the previous quarter. Analysts point to Apple’s fiscal third-quarter earnings as a sign that global growth could be cooling for the world’s largest technology company. Shares of Apple jumped 5.16 percent to close at $440.61 per share.

Caterpillar Inc. reported a lower quarterly profit than it did last quarter and cut its outlook for full-year earnings. In the second quarter, Caterpillar booked a profit of $960 million, or $1.45 a share, down from $1.70 billion, or $2.54 a share, a year earlier.

"China has been part of the slowdown in the last couple of years," Caterpillar Chairman and CEO Doug Oberhelman told CNBC after the company's earnings were released.

Shares of Caterpillar closed down 2.08 percent to $83.44 a share.

Ford Motor Company issued a better-than-expected second-quarter profit, and the stock jumped 2.54 percent to close at $17.37. The auto giant saw second-quarter profit rise $1.23 billion, while revenue was up 14 percent to $38.1 billion. Ford saw strong demand for its pickup trucks in North America and a record profit of $177 million in Asia. It also trimmed its expected full-year loss in Europe to $1.8 billion from $2 billion.

After the bell Wednesday, Facebook Inc. (Nasdaq: FB) reported second-quarter earnings of 19 cents per share on revenue of $1.81 billion, compared to a loss of 8 cents per share in the year-ago quarter on revenue of $1.18 billion. Analysts polled by Reuters expected Facebook to report second-quarter earnings of 9 cents per share on revenue of $1.62 billion. 

Shares of Facebook jumped 19.01 percent to $31.55 at 5:32 p.m. EDT in after-hours trading.

The Dow Jones industrial average fell 25.50 points, or 0.16 percent, to close at 15,542.24. The S&P 500 was down 6.45 points, or 0.38 percent, to end at 1,685.94. The Nasdaq Composite Index rose 0.33 points, or 0.01 percent, to finish at 3,579.60.

Doreen Mogavero, president and CEO of Mogavero Lee & Co., discusses Apple, Caterpillar, and Ford's second quarter earnings, and how the companies are affected by slowing growth in China and Europe.