The Supreme Court of Canada will hear a case this week that could determine whether toxic industrial sites across the country are cleaned up when a company goes bankrupt.

Billions of dollars in cleanup costs are at stake as banks seek assurances they aren't stuck with massive environmental bills, provincial governments hope environmental rules are followed and farmers worry they may be left with contaminated land from abandoned oil and gas wells.

For communities dotted with orphaned wells, this isn't just a legal debate. These wells can affect people's farmland for years, said Daryl Bennett, a surface rights advocate who farms in southern Alberta.

One farmer he knows has had a well in the reclamation process for roughly two decades. "We can still walk across this field [and] pick up a five-gallon bucket full of oil-soaked clods of dirt," he said.

We need to be able to ensure the people of Alberta, collectively, are protected. — Alberta Premier Rachel Notley

The case itself focuses on a small Alberta oil company, Redwater Energy, which entered creditor protection in 2015. Only a few of the company's assets had value, so the bank wanted to sell those wells to recover some of its debt and abandon the rest of the oil and gas sites. The question became whether Redwater's assets should help pay its debts or be used to pay for the cleanup cost of its worthless oil and gas wells?

The case will address a fundamental public policy dilemma about what happens when a resource company bites the dust. For instance, every mine in the country has environmental regulations attached to its licence about reclaiming the site when the mine closes.

But if the company goes belly up, does the bank take over those end-of-life responsibilities? If not, is the site abandoned or do taxpayers pick up the hefty tab?

A worker pulls pipe out of the ground at an orphan well site in Alberta. Since 2016, the Orphan Well Association's inventory has more than tripled to more than 3,700. (CBC)

Redwater Energy was a publicly traded junior oil and gas producer. Its main lender, ATB Financial, made a call on its debt and it entered receivership. The receiver felt only about 20 of 127 of Redwater's properties were worth keeping.

The Alberta Energy Regulator (AER) ordered the remaining wells to be closed and remediated. But the trustee rejected the order and said it would not pay to properly clean up the wells. That's when the regulator and the Orphan Well Association took the dispute to court.

Here's what's at stake for key stakeholders:

Billions on the line

Calling the outcome of the initial decision "catastrophic," the AER warns in its filings to Canada's highest court that it must overturn the case to restore 25 years of law and help ensure the safe and efficient reclamation of thousands of orphaned well sites.

"We need to be able to ensure the people of Alberta, collectively, are protected," Premier Rachel Notley told reporters this week.

Since the original court ruling in 2016, the amount of wells dumped on the regulator has rapidly increased; 1,800 AER-licensed sites have been abandoned, with estimated liabilities of more than $110 million. In the same period, the Orphan Well Association's inventory more than tripled from almost 1,200 to more than 3,700.

Cara Tobin, spokeswoman for the Alberta Energy Regulator, said the decisions by lower Alberta courts about Redwater poses a significant and unacceptable risk to Albertans. (Supplied by Cara Tobin)

Ultimately, the AER says the potential cost as a result of the Alberta court decision is staggering: $8.6 billion.

The regulator says the court effectively reduced all environmental and safety obligations to unsecured monetary claims.

"The Redwater decision impacts Alberta's constitutional right to manage its own resources," said AER spokeswoman Cara Tobin.

And by rejecting the "polluter pays" principle that underlies virtually all of Alberta's oil and gas legislation, it's shifted liability from the polluter to "innocent third parties and the public," according to the AER's legal filings.

"Lenders are now incentivized to prohibit debtors from spending current cash flow remediating environmental damage that these companies created," the AER contends.

"Secured creditors are also incentivized to place those companies into insolvency so that the obligations can be dumped onto the public."

Meanwhile, ATB Financial said the lower-court rulings in its favour don't negate Alberta's ability to protect the environment.

"One option open to Alberta would be to require remediation obligations to be paid up front, before companies are permitted to drill," said the Alberta government-owned bank in its submission to the Supreme Court.

"When the commodity cycle hits bottom and a debtor becomes insolvent, the AER cannot take action reactively and require that its Provable Claims be satisfied before all others."

Alberta's premier says as much as possible has to be collected from bankrupt companies to cleanup abandoned wells. 0:45

Ranchers want assurance

The Taber farm belt in southern Alberta is a favourite destination for visitors, come harvest. With an abundance of sunshine and irrigation, the area produces some of the richest crops in the province.

This is also the place that Daryl Bennett calls home, which perhaps explains why he's so determined to see it treated right. Bennett is a director with the Action Surface Rights Association, who will be represented at the Supreme Court on Thursday.

But if companies were simply able to walk away without any financial responsibility for remediation, Bennett fears the cleanup of orphan wells will become hopelessly backlogged while the burden of those bills is shifted onto Albertans.

"I don't think anybody, the legislators or the justices, contemplate a system where polluters can just walk away and dump the problem onto the taxpayers," Bennett says.

The oilpatch slump has left in its wake tens of thousands of abandoned oil wells, like this one near Three Hills, Alta. (Tracy Johnson/CBC)

Ontario government concerns

While it may seem strange for Ontario to speak up about an oil and gas case centred in Western Canada, the province has a long history of oil production dating back to 1858. In 2016, there were about 2,400 producing oil and natural gas wells in Ontario.

The provincial government is one of the interveners in this case and supports the AER's stance in defending the need for environmental regulations to be followed, even in the case of bankrupt oil and gas companies.

"Although certain regulatory orders can be compromised in bankruptcy, orders like the ones issued by the AER in this case can and should continue to operate in bankruptcy," according to the Ontario government's written submission to the Supreme Court.

Ontario argues the Bankruptcy and Insolvency Act does not allow a bankrupt company to avoid environmental remediation obligations.

The Saskatchewan and B.C. governments are also intervening, taking similar positions

Oilpatch on the hook

The oil and gas industry supports the AER's position, even though it may hurt its ability to loan money in the future.

Energy companies in Alberta pay into the Orphan Well Association, which cleans up abandoned wells after companies go bankrupt and can't cover the cost of remediation.

"I don't think there is anyplace in the world in any industry that I can think of where competitors step up in as big a way as they do in Alberta to pick up the environmental claims of their failed competitors," said Gary Leach, president of the Explorers and Producers Association of Canada, which represents junior and mid-sized oil and companies.

The levies paid by industry keep increasing, said Leach, in part because the oil and gas price collapse in recent years forced several companies to go under.

ATB Financial says court rulings in its favour don't 'nullify Alberta's ability to regulate and protect the environment.' (Kyle Bakx/CBC)

"If we didn't have an orphan fund that was funded by the oil and gas industry, those would be dumped on the public. That's the public policy issue here."

Those in the oilpatch acknowledge if the Supreme Court sides with the energy regulator, banks may tighten up lending because they'll have to consider the environmental liabilities of energy companies. However, Leach isn't overly concerned.

"I think most lenders in today's world are not so much looking at security anyway, they are looking at cash flow ability," he said.

The Canadian Association of Petroleum Producers is also an intervener in the case.