The largest city-owned utility in Texas on Friday sued the state’s grid operator alleging it levied “excessive” power prices during a February deep freeze, and seeking to bar the grid from issuing a default that could affect its credit rating.

High prices for emergency fuel and power during a severe cold spell left Texas utilities facing about $47 billion in one-time costs. Those costs have led to two bankruptcies and knocked two other electric providers off the state’s power grid because of payment defaults.

“We are fighting to protect our customers from the financial impacts of the systemic failure” of the state’s grid operator, said Paula Gold-Williams, chief executive of San Antonio’s municipal utility, CPS Energy.

CPS, which has some 820,000 electricity customers, faces about $1 billion in extraordinary charges for natural gas and electricity during a five day deep freeze last month.

Cold Weather Crisis

The lawsuit alleges grid operator Electric Reliability Council of Texas (ERCOT) mismanaged the cold weather crisis, and overcharged CPS Energy and others for power and services. It asked a Texas state court to prevent ERCOT from declaring it in default and to prevent ERCOT from charging CPS for other grid users’ defaults.

An ERCOT spokeswoman declined to comment on the lawsuit.

More than $3 billion in charges that ERCOT issued to grid users were in default as of Friday, a grid official said.

Credit rating firms this week cut their outlook on the utility’s debt and warned of further downgrades as size of the costs become clearer.

Fitch Ratings lowered some ratings and placed a negative outlook on CPS Energy’s long term debt while S&P Global said it could further cut debt ratings “one or more notches.”

ERCOT officials hiked power prices by about 400 times the usual rate to $9,000 per megawatt for five days last month in an effort to bring in more power. State officials this week called on ERCOT and the utility regulator to cut those charges for high-price power for the 32-hour period after the grid emergency passed.

‘Excessive’ Power Costs

CPS Energy’s lawsuit called ERCOT’s handling of the crisis “one of the largest illegal wealth transfers in the history of Texas.” It brought the complaint “to protect its customers from excessive and illegitimate power and natural gas costs,” according to the lawsuit.

Just Energy Group this week filed for bankruptcy as result of high power charges. The state’s largest and old cooperative, Brazos Electric Power Cooperative Inc, also filed for bankruptcy this month, citing $1.8 billion owed to ERCOT. Texas’ rural cooperatives pool their power and service purchases to gain efficiencies of scale.