Carl Icahn exited a big bet on Occidental Petroleum Corp., selling the last of what was once a roughly 10% stake in the oil-and-gas producer as its shares surge.

Mr. Icahn, who had been cutting the position, in recent days sold the remainder of it, according to a letter he sent to Occidental’s board Sunday. The move brings to a close one of Mr. Icahn’s most dramatic recent clashes, which began when he criticized Occidental for outbidding larger rival Chevron Corp. to strike a $38 billion deal to buy Anadarko Petroleum Corp….

Carl Icahn
exited a big bet on
Occidental Petroleum Corp.
, selling the last of what was once a roughly 10% stake in the oil-and-gas producer as its shares surge.

Mr. Icahn, who had been cutting the position, in recent days sold the remainder of it, according to a letter he sent to Occidental’s board Sunday. The move brings to a close one of Mr. Icahn’s most dramatic recent clashes, which began when he criticized Occidental for outbidding larger rival
Chevron Corp.
to strike a $38 billion deal to buy Anadarko Petroleum Corp. in May 2019.

The activist investor’s two representatives on Occidental’s board are also resigning, he said in the letter, as was required by a settlement agreement with the company at the onset of the pandemic.

Occidental’s shares plummeted in March 2020, allowing Mr. Icahn to double down on the investment, boosting his stake from 2.5% to around 10%. By that time, he had been arguing for almost a year that the Anadarko deal was an ill-conceived defensive move and campaigning for the ouster of Chief Executive

Vicki Hollub.
He also took issue with the $10 billion of pricey financing from

Warren Buffett
that Occidental relied on to pay for the deal.

An Occidental Petroleum facility in Hobbs, N.M.
Photo: ernest scheyder/Reuters

Mr. Buffett has been buying Occidental shares in recent days. As of Friday, Mr. Buffett’s
Berkshire Hathaway Inc.
reported owning roughly $5 billion worth.

Within weeks of Mr. Icahn raising his stake, he and Occidental called a truce that brought back former CEO

Stephen Chazen
as chairman and added three directors, including Mr. Icahn’s two representatives. Ms. Hollub remained CEO, and the company announced deep cost cuts.

Mr. Icahn thanked Mr. Chazen in Sunday’s letter, including for supporting his push to issue a free dividend of warrants that he said created over $4 billion of value for Occidental shareholders.

“While we certainly had our disagreements with Vicki Hollub concerning M&A, we thank her for using her well-honed operating skills and resiliency so well in Occidental’s darkest hours,” Mr. Icahn wrote. “We believe our relationship with Occidental turned out to be activism at its best.”

With the help of a surge in oil prices, Occidental’s shares have more than quintupled after sinking below $10 in 2020. They closed Friday at $56.15, just below where they were before the Anadarko deal was finalized.

Mr. Icahn realized a profit of around $1 billion on the investment, according to people familiar with the matter. He also has an unrealized net profit of roughly $500 million on the warrants, they said. He said in the letter that he still owns over 15 million warrants.

Mr. Icahn has recently been focused on a smaller energy company, the utility
Southwest Gas Holdings Inc.,
which last week announced plans to separate a subsidiary he had called for it to sell. He is also running a proxy contest at
McDonald’s Corp.
over its suppliers’ treatment of pregnant pigs. The latter is an atypical campaign for Mr. Icahn, who turned 86 last month, as he holds a tiny stake and doesn’t expect to turn a profit.

Russia’s attack on Ukraine helped push the price of oil to over $100 a barrel for the first time since 2014. Here’s how rising oil costs could further boost inflation across the U.S. economy. Photo illustration: Todd Johnson

The Wall Street Journal Interactive Edition

Write to Cara Lombardo at cara.lombardo@wsj.com