Canada's top court has agreed to review a ruling that could allow energy companies that have gone bankrupt to walk away from cleaning up abandoned oil wells.

The Alberta Energy Regulator, and the Orphan Well Association formally applied to the top court in July for leave to appeal what's known as the Redwater decision.

The Supreme Court said Thursday it has granted the application for leave to appeal.

Regulators are concerned that if the Redwater ruling stands, worthless oil and gas wells will be abandoned across the province as struggling oil operators fold.

Who pays?

"For the past two years, we have worked very hard at all levels of court to ensure the consequences of the Redwater decisions are fully understood," AER president and CEO Jim Ellis said in a statement.

"The decision allows creditors to benefit at the expense of the environment and responsible companies by permitting receivers to avoid regulatory requirements that were put in place to protect the public and environment," Ellis said.

"It allows owners of industrial facilities to walk away from their environmental responsibilities."

The battle began when Calgary-based Redwater Energy Corp. went bankrupt last year, triggering a fight between the AER and the provincially-owned ATB over the remains.

Does the lender get paid back first? Or should proceeds from any asset sales go to clean up the mess — namely those 70 non-operational wells that would otherwise be abandoned — the company leaves behind?

In May 2016, an Alberta Queen's Bench judge ruled in favour of the bankruptcy trustee of Redwater. The court ruled the sale of assets from bankrupt energy companies should go first to creditors, not to cleaning up the mess from the company's operations.

The Redwater Energy Corp. trustee and its lender, ATB Financial, wanted to sell off the company's remaining producing wells to pay creditors. They argued a bankruptcy trustee is free to pick and choose from among the company's assets and "disclaim" — legally abandon — unproductive oil and gas wells.

Those wells would be left to the Orphan Well Association, an industry-funded and government-backed group, to clean up.

But in a 2-1 decision released in April, the Alberta Court of Appeal backed the original judge, saying federal bankruptcy law takes precedence over provincial environmental rules.

'That impact cannot be undone'

While Redwater was a relatively small player in Alberta's energy industry, the court battle has far-reaching implications.

British Columbia and Saskatchewan both participated in the appeal in support of the AER because the case could act as a precedent in other provinces.

Since the Redwater decision came down, about 1,600 AER-licensed sites have been disclaimed by receivers, with estimated liabilities of more than $100 million.

"That impact cannot be undone," said Ellis. "But we are looking forward to presenting our arguments and are optimistic we may convince the Supreme Court to reverse the lower courts' decisions."