A John Deere 8600 tractor is displayed on opening day of the World Ag Expo on February 10, 2015 in Tulare, Calif.

Deere reported weaker-than-expected earnings on Friday as rising costs take a bite out of the tractor company's bottom line.

Deere posted adjusted earnings per share of $2.59 for its fiscal third quarter. Analysts at Reuters expected a profit of $2.75 per share.

CEO Samuel Allen said the company "continued to face cost pressures for raw materials and freight" during the quarter, "which are being addressed through a combination of cost management and pricing actions." The cost of production as a percentage of net sales increased to 77 percent from 75.2 percent in the second quarter.

The rise in costs comes as the Trump administration engages key economic partners in a trade spat. The U.S. has already slapped tariffs on billions of dollars worth in imports from China, Europe and Mexico.

China, the European Union and Mexico have all retaliated with levies on U.S. goods.

Deere's stock fell as much as 3.7 percent before recovering to close 2.4 percent higher.

Deere also reported better-than-expected revenue for the quarter, however. Sales totaled $9.286 billion versus an estimate of $9.211 billion. The company's revenue got a boost from strong sales in its agricultural and turf business, which came in at $6.29 billion.

The company's net income also rose 42 percent on a year-over-year basis to $910 million from $642 million, thanks in part to lower corporate taxes.

—Reuters contributed to this report.