Who would've thought one of the most unloved stocks in the Dow Jones Industrials until about a couple of years ago would become a market darling in such a short time span? Caterpillar Inc. (CAT 0.44%), the world's largest construction and mining-equipment manufacturer, that was struggling to keep its foot firm amid the hugely challenging business conditions, saw its stock soar a jaw-dropping 70% in 2017. Caterpillar was among the most powerful Dow comeback stories in 2017.

Caterpillar's recovery was long due, but the dramatic run-up in the stock has stoked bulls and bears alike. So on one hand, Caterpillar shares have been retreating ever since the company released its fourth-quarter numbers and guidance for 2018 last week, hinting that the stock may have run its course. On the other hand, some analysts firms have turned increasingly bullish about Caterpillar in recent weeks.

With Wall Street clearly divided over Caterpillar, here's what you, as an investor, should expect from the company and its shares in 2018.

Why 2017 was a significant year for Caterpillar

While several factors fueled Caterpillar's rally in 2017, management's conservative guidance hugely helped the company exceed expectations quarter after quarter, fueling investor optimism. Last week was no different, when Caterpillar reported its fourth-quarter and full-year numbers, beating its own estimates yet again.

A road sign with the words risk and reward written on it against the backdrop of blue sky.

Has Caterpillar stock become risky, or is there still some steam left? Image source: Getty Images.

The following table should give you an idea how dramatically management's outlook for 2017 improved as the year progressed. 

Metric Actual FY 2017 Projected FY 2017 (As of Q3) Projected FY 2017 (As of Q2)  Projected FY 2017 (As of Q1)
Revenue $45.5 billion $44 billion $42 billion-$44 billion $38 billion-$41 billion
GAAP EPS $1.26 $4.60 $3.50 $2.10
Adjusted EPS $6.88 $6.25 $5 $3.75

Data source: Caterpillar Inc. financials. 

Don't let that sharp drop in Caterpillar's actual EPS for fiscal 2017 detract you. Caterpillar booked a $2.37 billion tax provision during the fourth quarter related to the repatriation of non-U.S. earnings under the recently enacted U.S. tax reform legislation. Otherwise, the company turned an operating profit of $4.4 billion in 2017, versus only $498 million in fiscal 2016. 

Don't get me wrong. I'm not trying to say management's conservative forecasts alone boosted Caterpillar's shares. But management wouldn't be bullish if not for improving business conditions, and the recovery has been faster and stronger than anyone expected. 

How are Caterpillar's key end markets doing?

Caterpillar is seeing a broad-based recovery in sales, with sales volumes improving in each of its business segments -- construction industries, resource industries (primarily mining equipment), and energy and transportation. Among these, construction industries sprung up the biggest surprises last year, as demand for equipment from the Asia-Pacific region, particularly China, surged. An uptick in residential and non-residential construction in North America is providing further support. 

Several mining trucks operating at a site.

Image source: Getty Images.

The biggest turnaround, though, can be seen in Caterpillar's resource industries division -- which clocked a 53% jump in year-over-year sales during the fourth quarter -- thanks to recovering commodity prices that are breathing life into the beleaguered mining sector. In a recent interview with Mining Global, Agustín Costa, partner and managing director at The Boston Consulting Group, pegged spending by major miners to hit $41 billion in 2017, up 7% year over year.

And let's not forget the oil price recovery in the latter half of 2017, which gave Caterpillar bulls yet another reason to propel the stock. Take a look at how Caterpillar shares mirrored the rise in oil prices after July 2017:

CAT Chart

CAT data by YCharts.

Why 2018 could be one of Caterpillar's best years

The ongoing recovery across all its key end markets should propel Caterpillar's sales and earnings higher. This is what Caterpillar expects from each market:

  • Construction industries: Improving North American residential, non-residential, and infrastructure markets. Strong sales from China.
  • Resource industries: Greater capital spending as miners "invest in equipment replacement cycles." Higher machine utilization should drive aftermarket demand.
  • Energy and transportation: Strong demand for reciprocating engines and turbines from the oil and gas sector. Challenging locomotive and marine markets, but a potential recovery in power generation.

Overall, Caterpillar projects higher sales volumes to be the biggest growth driver of profits in 2018, which is a surefire sign of better days ahead for the company.

The best part, however, is Caterpillar's profit guidance for fiscal 2018: It expects to earn a profit of $7.75 to $8.75 per share. The company last hit those earnings level around 2012-2013, when business was at its peak.

CAT Free Cash Flow Per Share (Annual) Chart

CAT Free Cash Flow Per Share (Annual) data by YCharts

There's another incredible takeaway from that chart: Caterpillar's cash flows are on solid footing, with the company consistently converting 100% or more of its net income into free cash flow. In fact, Caterpillar even increased its dividend last year, marking the 24th consecutive year of dividend increases. That also means the company is just one dividend increase away from joining the elite Dividend Aristocrat group. 

The Foolish bottom line

Caterpillar's solid outlook does not include any impact of a potential uptick in infrastructure spending in the U.S. if President Trump were to pass his $1 trillion spending bill in the near future. Given Caterpillar's foothold in the industry and unparalleled brand power, it'll probably be one of the biggest beneficiaries when infrastructure spending kicks off.

Keeping that in mind, I can say Caterpillar's operational turnaround may have just started. And while there will be instances of profit booking given the stock's incredible rally, Caterpillar remains one of the best cyclical stocks you could own for the long haul.