Caterpillar reported quarterly earnings and revenue that handily topped analysts' expectations on Thursday.

Here's how the company did compared with what the Street expected:

EPS: $2.16 per share vs. $1.79 expected, according to Thomson Reuters

Revenue: $12.9 billion vs. $11.98 billion expected, according to Thomson Reuters

The company's stock popped nearly 4 percent in premarket trading following the report, before settling below 3 percent.

Caterpillar's quarterly results include a $2.4 billion charge, equal to $3.91 per share, due to the enactment of the tax reform legislation signed into law in December.

The company also issued 2018 guidance that exceeded analysts' expectations. Caterpillar expects adjusted earnings per share between $8.25 and $9.25, ahead of FactSet analysts' forecasts of $8.15 per share.

"We are in the early stages of implementing our strategy for profitable growth," CEO Jim Umpleby said.

The machinery manufacturer was the second-best performing stock on the Dow Jones industrial average in 2017.

The company could also stand to benefit from the Republican tax overhaul signed into law in December. Analysts at J.P. Morgan Chase upgraded Caterpillar shares in January, crediting the Republican tax bill for their positive outlook on the company.

However, Caterpillar's current method of handling its taxes — namely, by using a Swiss subsidiary to slash its corporate rate — could be compromised in a $2 billion fight with the IRS.