The yearlong fight over who should benefit from a big, unexpected discovery of natural gas in a rock formation used for gas storage is headed to court, where the owner of the storage facility hopes to overturn a requirement that established how much of its good fortune should be shared with others.

The Regulatory Commission of Alaska issued an order last month allowing the gas-storage utility, Cook Inlet Natural Gas Storage Alaska, to sell a portion of the discovery. But the RCA said the storage company had to share the bulk of the proceeds with customers — four Southcentral Alaska utilities — that store natural gas in the facility beneath the city of Kenai.

The RCA, in a decision supported by four of five commissioners, said it expected the sale proceeds to benefit ratepayers, helping hold down natural gas and electricity costs across much of Southcentral Alaska.

CINGSA instead had supported a settlement agreement the RCA rejected that would have returned a smaller portion of the proceeds to its customers, leaving more for CINGSA, which is primarily owned by Mid-American Energy in Iowa and AltaGas of Canada.

The origins of the dispute date back to 2012, when CINGSA found 14.5 billion cubic feet of gas in what was thought to be a "depleted" reservoir. The discovery came during drilling as CINGSA developed the gas-storage unit, a facility designed to help Southcentral Alaska utilities weather the ups and downs of seasonal demand.

That amount of gas would meet about one-fifth of the natural gas consumed in the Cook Inlet region in an average year. Selling just 2 billion cubic feet of it, an amount proposed by CINGSA as a starting point, would have produced about $15 million, according to a state estimate in spring 2015.

The discovery has been called a "happy accident" and a "white swan," with the RCA noting that seemingly "all involved should be grateful for this fortuitous circumstance."

But the windfall is also unique, with no explicit statute or case law to determine how it should be divvied up, the RCA said. The lack of clarity has contributed to a lengthy, wide-ranging fight before the commission.

CINGSA in early 2015 initially asked the RCA for permission to sell 2 billion cubic feet of the gas and keep the proceeds for its owners, who provided the startup capital for the $160 million storage unit. It said most of the discovery would stay in the ground to help provide more pressure in the reservoir than was initially intended. That would help gas flow easier, offsetting costs for ratepayers by reducing the number of wells that need to be drilled.

The state's Regulatory Affairs and Public Advocacy section of the attorney general's office objected to CINGSA's plans to keep the proceeds for itself, saying the discovery was a byproduct of the creation of a facility that will ultimately be paid by CINGSA's customers in the form of rates.

"Since the costs of operating CINGSA are borne by the ratepayers, the ratepayers should get the benefit of profits from the gas," said Jeff Waller, the state's lead attorney in the case.

Three of the utility's customers, Chugach Electric Association, Anchorage Municipal Light and Power and Homer Electric Association, supported the state's argument. The facility's fourth customer is Enstar Natural Gas, an affiliate of CINGSA owned by AltaGas.

Enstar did not file a motion before the RCA. But it later joined in settlement discussions that led to a compromise from CINGSA.

In the compromise — the proposed settlement submitted to the commission — CINGSA would take half the proceeds from a sale of 2 billion cubic feet. The other half of the proceeds would go to the four utilities.

The agreement also provided for additional sales of gas in the future, the RCA said.

But three parties in the RCA case did not join the settlement. They were ML&P, the state, and Tesoro Alaska, a gasoline refiner and large electric ratepayer, the RCA order said.

Lindsay Hobson, communications manager at Enstar, said ML&P did not sign the settlement agreement but supported it before the RCA during the hearing.

Julie Harris, public relations manager at ML&P, said the utility would not comment on its position.

"We don't have a comment and the settlement negotiations are confidential," she said.

The RCA, pointing out in part that CINGSA could not have been built without the 20-year commitment from the utilities, decided that the proposed agreement was not in the public interest.

The commission decided that 13 percent of the proceeds should go to CINGSA. The other 87 percent would go to the four utility customers, to be divided primarily on the amount of gas each can store in the facility.

"We expect ENSTAR, Chugach, ML&P, and HEA to pass the net proceeds on as a benefit to their customers through a reduction in their respective gas cost adjustment or cost of power adjustment," the order said.

All five commissioners heard the argument. Commissioner Jan Wilson, who was appointed for six-year terms by former Republican governors Frank Murkowski in 2006 and Sean Parnell in 2012, dissented in part.

Wilson said she also supported denying CINGSA's original request to sell a portion of the discovery, saying her job as a regulator involves ensuring safe service and reasonable rates, not splitting up proceeds from natural gas sales. But she said in her view, CINGSA has a "property right" to produce and sell 2 billion cubic feet of gas.

CINGSA told the RCA early this month it will appeal the decision, calling it an "unconstitutional taking without just compensation" of assets that it "undisputedly" owns. It said the proposed settlement was in the public's interest and had support from CINGSA's customers. It said the commission based its decision on an "arbitrary and unfounded allocation formula."

The case is before Anchorage Superior Court Judge Eric Aarseth. Arguments have not yet been filed.

"CINGSA is appealing the RCA decision in order to defend its private property rights, due process rights, and to protect the settlement process," said Enstar's Hobson.