[Editor's note: This story was updated at 3:01 p.m. CT June 25.]

Occidental Petroleum Corp. will write down the value of its oil and gas properties by up to $9 billion this quarter and restructure some debts to avoid a possible default, the company said June 25.

The U.S. oil producer is trying to shed nearly $40 billion in debt from its purchase of rival Anadarko Petroleum last year, an ill-timed bet on rising oil prices ahead of a historic market crash.

The latest write-down stems from declining energy demand amid the COVID-19 pandemic and global glut that has oil trading 38% below what it cost in January. Occidental and many of its peers dismissed workers and cut budgets by billions of dollars as energy markets fell.

Occidental plans to replace $9.12 billion in notes due in 2021 and 2022 and issue new notes that would remove provisions that could have pushed it into default.

Warren Buffett's Berkshire Hathaway Inc., which last year bought $10 billion of Occidental preferred shares to help it finance the Anadarko deal, will receive a June 30 dividend in shares, Occidental said, to save cash.

With its share price down 57% year to date, Occidental must pay the dividend with increasingly more stock, giving Berkshire a growing stake in the company, said Houston energy economist Ed Hirs.

"There’s no clear horizon to anyone getting any value other than Buffett," Hirs said.

Occidental and Buffett were not immediately available for comment.

Ratings firm Moody's Investors Service on June 25 downgraded its rating on Occidental's debt one notch to Ba2 and issued a "negative" outlook. Rival Fitch Ratings raised its rating on the notes to BB with a "stable" outlook.

The Anadarko purchase left Occidental "with over $35 billion of debt and $10 billion of preferred stock, compromising its financial flexibility to confront the collapse in oil prices," said Andrew Brooks, a Moody's vice president.

This will be the third consecutive quarter in which Occidental takes a write-down, bringing the total to as much as $12 billion in the last nine months, more than half of its market capitalization.

The oil price crash has other oil and gas companies chopping the value of their assets. The industry's total reductions could reach $300 billion starting this quarter, according to accounting and consulting firm Deloitte.

Occidental recently set a July 1 deadline to accept bids for properties in Wyoming and Colorado that could bring up to $700 million.

"So far the only successful divestitures were some of the LNG assets in Mozambique," said Espen Erlingsen, an analyst at Rystad Energy.

The company needs to complete asset sales, which remain "challenging in the current environment," said Jennifer Rowland, analyst with Edward Jones. "They've put themselves in a tough situation and have a long way to go to get themselves back in a healthy position, especially if oil prices stay low for longer."

It cut its quarterly dividend last month to just a penny per share after having slashed it 86% in March to save cash.