VICTORIA -- The British Columbia government will ask a court if legislative amendments allow it to control the flow of heavy oils through the province to protect human health, the environment and communities.

The reference question the government is filing Thursday with the B.C. Court of Appeal seeks to affirm the province's right to protect it from the threat of a diluted bitumen spill as it tries to thwart the Trans Mountain pipeline expansion.

In addition to asking the court to review proposed amendments to the Environmental Management Act that would give the province the authority to regulate the impacts of heavy oils, it will also ask if federal legislation would override its changes to the law.

Provincial government officials say the court decision in B.C. could be appealed to the Supreme Court of Canada.

Premier John Horgan said the reference case is aimed at protecting B.C.'s coastline and economy from the harms of an oil spill.

"We believe we have been on a course all along to defend the interests of British Columbians," he told a news conference. "I believe we're on the track we set out to be on. I don't want to say this is the beginning of the end. This is another step."

B.C.'s efforts to stop the expansion of the pipeline from Edmonton to Burnaby caused Kinder Morgan Canada to curtail spending on the $7.4-billion project earlier this month.

The company set May 31 as the deadline for governments to find a solution to the impasse and Prime Minister Justin Trudeau has repeatedly vowed that the project will go ahead.

B.C. Attorney General David Eby said it is highly unlikely the court will release a decision by the May 31 deadline.

Horgan said the province isn't working to Kinder Morgan's deadline.

"I don't work for Kinder Morgan," he said. "I work for the people of B.C."

The expansion was approved in 2016 by the federal government and would double an existing pipeline to Kinder Morgan's Westridge Marine Terminal, where diluted bitumen would be loaded onto oil tankers for export.

Many environmental groups fear an increase in tanker traffic out of Burnaby along marine routes that are at times extremely narrow, compounds the risk of a major spill.

Trudeau has said he only approved the pipeline in the context of balancing the need for environmental protections with the need for economic growth. The government's $1.5-billion Oceans Protection Plan is designed to account for such spills, he said, suggesting the government would make additional investments if need be.

The dispute has caused a rift between B.C. and Alberta, which has responded by threatening to slow the flow of oil and natural gas to its neighbour in retaliation.

Alberta needs to get more of its oil to market, arguing a lack of access and pipeline bottlenecks are costing Canada $40 million a day as it pins its hopes on the Trans Mountain pipeline expansion.

B.C. Environment Minister George Heyman downplayed the ability of the Oceans Protection Plan to protect the province's environment.

"We know that British Columbians have a deep, personal connection with our coast, a deep connection with our fish, our wildlife. It's our responsibility to defend the interests of British Columbians."