Warren Buffett is getting involved in a rare bidding war unfolding in the energy industry.

Berkshire Hathaway has committed a $10 billion preferred stock investment in Occidental Petroleum contingent on the company completing its proposed takeover of Anadarko Petroleum. Last week, Occidental made a rival bid for the oil and gas driller, challenging Chevron's $33 billion buyout of Anadarko.

Shares of Occidental fell 2% on Tuesday, while Chevron's stock popped 3%. A company's stock price often falls when investors believe it is about to acquire a company. Anadarko's shares fell about half a percent.

The capital injection from Berkshire could make Occidental a more formidable suitor. In pursuing Anadarko, Occidental is going toe to toe with an oil major with a much bigger balance sheet and whose market capitalization is nearly five times its value.

Several analysts initially downgraded shares of Occidental following its bid, with many saying the buyout would carry more risks than Chevron's proposed takeover of Anadarko. Achieving the benefits of the deal depends in part on Occidental's successful divestment in $10 billion-$15 billion in assets and achieving $3.5 billion in savings from the tie-up.

Berkshire's involvement suggests the company believes Occidental is best positioned to wring value out of Anadarko's portfolio. Occidental is focused on Anadarko's acreage in the Permian Basin, the U.S. shale oil region stretching across western Texas and southeastern New Mexico.

Occidental CEO Vicki Hollub has pitched Occidental as a high-performing Permian driller that can enrich Anadarko shareholders by squeezing more oil and gas from the drillers' wells at lower costs.

"We are thrilled to have Berkshire Hathaway's financial support of this exciting opportunity," Hollub said in a press release.

Here's how the Berkshire deal is structured:

Berkshire will receive 100,000 shares of cumulative perpetual preferred stock with a value of $100,000 a share.

The conglomerate also gets a warrant to purchase up to 80 million shares of Occidental at an exercise price of $62.50 a share.

The preferred stock will accrue dividends at 8% annually.

The Oracle of Omaha is an active investor across the energy sector.

Berkshire Hathaway is one of the top shareholders in oil refiner Phillips 66, and the firm took a new stake in Canadian oil and gas company Suncor earlier this year. Through Berkshire Hathaway Energy, Buffett has invested billions in natural gas power plants and pipelines, renewable energy and electric transmission and distribution.

Occidental has offered $76 a share for Anadarko, while Chevron's initial bid was $65 a share. On Monday, Anadarko restarted talks with Occidental after its board determined the offer could be superior to Chevron's bid.