Oil companies around the world have felt the pain of sustained lower crude oil price levels, with only the largest and best-run companies such as Exxon Mobil Corporation (NYSE:XOM) able to retain the majority of their market capitalization since the middle of 2014, when prices began to tank. XOM stock remains about 20% lower from that point.

That’s downright merciful compared to many of its smaller competitors. Even large peers such as BP Plc (ADR) (NYSE:BP) and Royal Dutch Shell plc (ADR) (NYSE:RDS.B) are off by closer to 30% in that same time.

Today, we’ll look at Exxon Mobil’s underlying fundamentals and a long-term perspective for investors looking for a buy-and-hold dividend investment in the oil and gas space.

Earnings, Earnings, Earnings

Compared with the vast majority of its peers, Exxon Mobil is a company that has produced truly amazing earnings results over the past two years, turning a massive profit in both 2015 and 2016 of $16.2 billion and $7.8 billion, respectively.

This past quarter, XOM more than doubled its profit from a year earlier and has continued to generate tremendous free cash flow, placating investors who have been waiting for a positive earnings surprise for some time.

While profits are still significantly down from the 2013-2014 level of $32.5 billion, the oil giant has continued to increase its dividend distributions each year for the past 30 years — an impressive track record. Exxon Mobil — which currently is paying out much more than 100% of the company’s earnings to shareholders via dividends — has a very long-term outlook and has diversified its portfolio further to provide investors with additional upstream and downstream revenue streams to smooth out the short-term effects of lower oil prices further.

Earnings drivers vary for the company’s business segments. I’ll break down the key segments and the earning drivers investors should pay special attention to when considering XOM stock for a long-term investment.

Upstream Production

The production of oil from the United States and around the world is the primary driver of revenues and growth for Exxon Mobil; however, we can see a divergence in profitability for XOM within the domestic and international portions of its oil production operations.

On the whole, we can see that international upstream production has contributed earnings of $4.35 billion in 2016, while domestic production has produced a net loss of nearly the same amount ($4.15 billion to be exact) during the 2016 fiscal year. The company has benefited from a number of high-margin plays internationally to offset the rather low-margin (and in many cases negative-margin) production domestically due to persistently low oil prices.

How the company chooses to adjust its production mix moving forward will be an interesting variable to assess.

From a balance sheet perspective, Exxon Mobil has been in the same situation as many of its peers in the oil industry with respect to its debt load. Also, continuing to maintain its impressive dividend has meant that XOM has had to lever up its balance sheet, despite cutting capital expenditures significantly since 2014 (from $34.2 billion in 2014 to $16.1 billion in 2016).

Downstream Operations

Exxon Mobil’s refining business tends to smooth out overall returns in times of depressed oil prices. That’s because refining profits are not completely dependent on oil prices.

While refiners must pay the market price for its inputs (crude oil), the outputs produced by the refineries are somewhat independent of input prices and provide a spread (the crack spread) from which refiners generate profit. The larger the crack spread, the greater the gross margin for refining operations.

In the first quarter of 2017, the crack spread for refiners began to widen, especially over the final month of the quarter. Should this spread hold, refiners will continue to produce increased profits through the second quarter, giving investors another reason to have faith in XOM’s ability to increase its earnings levels and maintain its dividend distributions moving forward.

Bottom Line on Exxon Mobil

Exxon Mobil is a company with strong fundamentals in an oil industry plagued by some pretty nasty looking balance sheets.

It’s not pretty right now, and low oil prices will continue to weigh on the stock. Still, XOM stock delivers about as bulletproof a dividend as you could want, and at 3.7%, it’s better than what most similar-sized blue chips have on offer.

As of this writing, Chris MacDonald did not hold a position in any of the aforementioned securities.