CALGARY -- A Calgary judge has denied British Columbia's attempt to block Alberta legislation that would allow that province to stop oil shipments to the coast.

In a decision released Friday on the so-called Turn Off the Taps bill, Queen's Bench Justice Robert Hall said that B.C. doesn't have the right to take Alberta to court in Alberta over legislation passed by the Alberta legislature.

"The only parties with standing to bring this action in this court are the (Attorney General of Alberta) and the (Attorney General of Canada)," Hall wrote in his decision.

Hall said neither province could find a single previous example of such a case going ahead.

"Neither party could direct me to any cases in which one province has sued another province seeking a declaration of constitutional invalidity of legislation enacted by the defendant province."

Hall said the proper venue for the disagreement is Federal Court, which was specifically created to adjudicate between governments.

"Federal court is the proper forum for this interprovincial dispute."

B.C. Attorney General David Eby said the province is reviewing Hall's decision. He said B.C. has already filed a similar case in Federal Court, although that body hasn't said yet whether it will accept it.

"The Province has been clear that we will defend the interests of British Columbians," Eby said in an email. "We ... look forward to the day that this legislation, which is unconstitutional and designed to punish people in B.C., is heard in court."

A statement released Friday night on behalf of Alberta Energy Minister Sonya Savage said the province was "pleased" with the court ruling.

"We will continue to defend Alberta jobs and economic opportunity and look forward to making our case in Federal Court," the statement said.

The legal battle is part of the fallout over the TransMountain pipeline expansion.

In response to B.C.'s legal measures against the pipeline, Alberta passed legislation that would allow it to shut off oil shipments to the coast.

B.C. had asked the Alberta court to both declare the law unconstitutional and grant an injunction preventing its implementation.

The TransMountain expansion, first approved in 2016, would triple the amount of oil flowing from the oilsands to B.C.'s Lower Mainland and from there to lucrative new markets across the Pacific.

The federal government bought the existing pipeline last year for $4.5 billion after its original builder, Texas-based Kinder Morgan, threatened to walk away from the project because of B.C.'s resistance.

The Federal Court of Appeal quashed the approval months later on the grounds that there hadn't been enough consultation with First Nations or consideration of the pipeline's potential impact on marine wildlife.

The project has been approved for a second time by the federal cabinet.