Pacific Gas and Electric Company, which has been struggling with a financial crisis stemming from California’s historic wildfires, intends to file for Chapter 11 bankruptcy protection by the end of the month, according to a regulatory filing.

The company, which is the largest investor-owned utility in California, said it faced an estimated $30 billion liability for damages from the 2017 and 2018 wildfires that killed scores in Northern California, a sum that would exceed its insurance and assets. The filing followed the announcement Sunday night that PG&E’s chief executive, Geisha Williams, would step down.

By early afternoon trading on Monday, the company’s shares had fallen nearly 50 percent. They had already lost almost two-thirds of their value since early November, when the company’s equipment was linked to the Camp Fire, which destroyed thousands of homes in Paradise, Calif., and killed at least 86 people.

PG&E’s problems could be the harbinger of more turmoil in California’s energy sector. The state, which prides itself on being a leader in the fight against climate change, has in recent years had to contend with much larger and more destructive wildfires, many of them caused by or linked to utility equipment. Industry executives have been lobbying the California Legislature to protect them financially by allowing them to raise electricity rates to help pay for property damage caused by fires, an effort in which they have been partially successful.

Some experts say that the state could be on the cusp of its second energy crisis in less than two decades. In 2000 and 2001, California was roiled by blackouts, soaring electricity rates and the bankruptcy of PG&E after a botched deregulation by the state.

PG&E’s filing with the Securities and Exchange Commission said the company planned to file for bankruptcy “on or about Jan. 29,” saying the move was “ultimately the only viable option to restore PG&E’s financial stability to fund ongoing operations and provide safe service to customers.”

The filing noted that the company was required to give employees 15 days’ notice of such a move, under a recently passed California law.

One possibility is that another utility company will take over all of PG&E, or parts of its business. It is the primary gas and electricity supplier to the northern half of California, serving about 16 million customers over 70,000 square miles.

Fire investigators determined that PG&E equipment was responsible for at least 18 of 21 major fires in 2017 as well as blazes in 2018. Some of the fires have been attributed to power lines coming into contact with trees, which critics have said is a result of the utility’s failure to trim the trees.

The billions in potential costs have prompted a series of downgrades in PG&E’s ratings, including decisions last week by Moody’s Investors Service and S&P Global Ratings to downgrade the utility’s bonds to junk.

The “action is driven entirely by the further weakening of Pacific Gas and Electric Company’s credit quality,” Moody’s stated in its decision.

Gov. Gavin Newsom, who took office last week, has said that responding to the utility and wildfire issues is among his top priorities. Officials have said that a bankruptcy filing would not jeopardize the provision of gas and electricity.

After intense lobbying, the state’s investor-owned utilities, which include Southern California Edison and San Diego Gas and Electric, won a legislative shield last year from having to bear the cost of 2017 fires. The law allows them to pass the cost of wildfires to their customers in the form of higher electricity rates.

Now they are seeking the same for last year’s fires. State law requires utilities to compensate property owners for fire damage caused by their equipment, regardless of whether negligence is proved.

In its filing Monday, PG&E said it was aware of 50 complaints on behalf of at least 2,000 plaintiffs in connection with the Camp Fire, including six seeking to be litigated as a class action. It also cited 700 complaints on behalf of at least 3,600 plaintiffs related to 2017 wildfires, including five seeking to be certified as class actions.

The utility companies acknowledge that they may bear some responsibility for wildfires but say it is not entirely their fault, because climate change and development in remote areas have made wildfires more destructive.

PG&E’s safety culture has also been under scrutiny since it was found at fault in a natural-gas explosion in 2010 that devastated the San Francisco suburb of San Bruno and killed eight people. The company was fined a record $1.6 billion by the state for failing to maintain its pipeline system properly, and it paid $900 million to resolve lawsuits related to the explosion.