Occidental Petroleum (OXY -0.42%) is one of the largest oil and gas producers in the U.S., but it's only in recent years that the stock has gained momentum. If you'd invested $10,000 in Occidental Petroleum three years ago, your investment would be worth around $22,500 as of this writing. In other words, the oil and gas stock has more than doubled investors' money in just three years.

There are specific reasons Occidental Petroleum stock zoomed in three years and could continue to rally even higher.

The magic of a turnaround -- and Buffett

Occidental Petroleum was saddled with heavy debt after its massive 2019 acquisition of Anadarko Petroleum, when oil prices plunged to zero in 2020 at one point. The oil and gas giant slashed its dividend, and its stock crashed.

Occidental Petroleum has come a long way since then. It has repaid debt aggressively, grown its cash flows consistently, resumed dividend growth in 2021, and raised its dividend every year since. The company's swift turnaround caught investors' attention, and its stock price skyrocketed in three years.

In between, legendary investor Warren Buffett -- who also helped Occidental Petroleum acquire Anadarko -- has been a big buyer of the oil and gas stock.

Buffett's company Berkshire Hathaway started purchasing Occidental Petroleum shares in 2022. As of March 31, 2024, it had had raised its stake in the oil and gas company to 28.2%. Today, Occidental Petroleum is among Berkshire Hathaway's largest holdings.

Buy and hold Occidental Petroleum stock

Buffett's backing, of course, is a big factor behind Occidental Petroleum stock's rally. That said, it's one of the most diversified energy companies in the U.S., with upstream, midstream, chemicals, and low-carbon ventures businesses, as well as an eye on growth.

Occidental Petroleum is about to acquire privately held CrownRock in a $12 billion deal to expand its footprint in the Permian Basin. After the acquisition, the company expects to cut debt further and resume share repurchases, which could fuel the next leg of this oil and gas stock's bull run.