What happened

Shares of Occidental Petroleum (OXY -0.56%) rocketed upward by 103.1% in the first half of 2022, according to data provided by S&P Global Market Intelligence. That's a particularly impressive showing considering that the S&P 500 was down almost 21% during that period. 

So what

Oil prices soared in the first half of 2022. The U.S. oil price benchmark, West Texas Intermediate crude, jumped almost 41%, while the global benchmark, Brent, surged nearly 48%, with both topping $100 a barrel in the first half. That was Brent's best start to a year since 2009. 

Several catalysts have helped drive oil prices skyward this year. The industry has significantly underinvested in new supply since the pandemic began. The supply shortage worsened when Russia invaded Ukraine, after which much of the world imposed sanctions on Russia's energy exports. That left nations scrambling to replace Russian oil. Meanwhile, demand has improved sharply as pandemic-related travel restrictions have eased.

The surge in crude oil prices has been a boon for Occidental Petroleum. The oil company generated $3.3 billion in free cash flow during the first quarter. It used all of those funds to repay debt, retiring 12% of its outstanding principal in the quarter. That continued its steady progress on improving its balance sheet. 

With its financial position improving, Occidental could start returning more cash to shareholders. The company boosted its quarterly dividend by an eye-popping 1,200% this year, though its payout is still far below what it distributed prior to the pandemic. The oil giant also reactivated its share repurchase program and expanded the buyback authorization to $3 billion. 

The company's improving financial position and shareholder returns impressed Warren Buffett, and Berkshire Hathaway (BRK.A 0.61%) (BRK.B 0.79%) continued to scoop up its shares this year. By early July, Buffett's conglomerate held 18.7% of Occidental Petroleum's outstanding shares, which are now worth about $10.8 billion. In addition, Buffett's company owns $10 billion of Occidental's preferred stock and has warrants to buy another 83.9 million shares for $5 billion. Buffett's heavy buying of Occidental has investors speculating that he might eventually acquire the whole company. 

Now what

Occidental Petroleum had a great first half of 2022 thanks to booming oil prices and Buffett's buys. The oil stock could continue rallying in the second half if those two catalysts continue. However, it's also possible that Occidental could give back some of those gains if oil prices cool off, which could happen if the economy slides into a recession and demand for oil ebbs. Because of that, investors should be aware of the downside risk before buying Occidental Petroleum in the wake of its scorching first half.