A state of Michigan lawsuit that aims to force Enbridge Inc. to stop operating the Line 5 oil pipeline underneath the Straits of Mackinac in the Great Lakes will be heard in federal court, a judge ruled on Aug. 18.

The decision from Judge Janet Neff is a win for Calgary, Alberta-based Enbridge. The Canadian pipeline company has been locked long-running dispute with Michigan over Line 5, which ships 540,000 bbl/d of crude and refined products from Superior, Wisconsin, to Sarnia, Ontario.

A 4-mile (6.4-km) section of the aging pipeline runs underwater through the Straits of Mackinac and environmentalists are concerned about the risk of an oil leak. Michigan ordered the pipeline to shut down by May 2021, which Enbridge ignored, and the two sides are embroiled in a legal battle over Line 5’s fate.

The lawsuit was originally filed in state court in June 2019 by Michigan Attorney General Dana Nessel, but Enbridge argued it came under federal jurisdiction.

“The State’s attempts shut down this critical energy infrastructure raises important federal questions of interstate commerce, exclusive federal jurisdiction over pipeline safety and the serious ramifications for energy security and foreign affairs if the State and the U.S. government were to defy an international treaty with Canada that has been in place since 1977,” Enbridge spokeswoman Gina Sutherland said in a statement.

A 1977 pipeline treaty governs the free flow of oil between Canada and the U.S., and last year Ottawa warned shutting down Line 5 could sour relations with Washington.

Environmental campaigners opposed to Line 5 said the judge’s latest decision undermined state court proceedings.

“The State of Michigan now will have to expend precious resources relitigating matters it has already litigated in state court for more than two years,” said Zach Welcker, legal director of environmental group FLOW.