Michigan Governor Gretchen Whitmer says Enbridge Inc. has until Wednesday to shut a huge crude pipeline that crosses the Great Lakes. The Canadian company says it’s got the law on its side, and the oil will keep flowing.

The standoff is the latest milepost in the increasingly tense dispute over Line 5, a 540,000 barrel-a-day line that supplies half of the oil and propane used by parts of the U.S. Midwest and Ontario.

Whitmer argues the pipeline, built in 1953, is too exposed to potential accidents where it crosses at the Straits of Mackinac in the northern part of the state. But the two sides are in a court-ordered mediation, and Enbridge plans to keep the line running while that plays out -- prompting Whitmer to threaten to sue to take any profits it makes.

The stakes are significant. Shutting the pipeline would require tens of thousands of trucks and hundreds of rail cars to transport oil and fuel by road, Enbridge has warned. Homeowners that rely on propane to warm their homes in Michigan could see prices increase. Airports in Detroit and Toronto receive jet fuel from local refineries supplied by Line 5.

As the cyberattack on the Colonial Pipeline has shown, the loss of a major pipeline, even temporarily, can roil markets for crude and refined products. Whitmer, who faces a potentially difficult re-election fight next year, is trying to shut the Enbridge line years before a replacement can be built.

Canada submitted an amicus brief to a U.S. federal court in Michigan on Tuesday in an effort to boost Enbridge’s case. The document “coveys Canada’s belief that the U.S. federal court is the proper jurisdiction to hear the case between Michigan and Enbridge,” Natural Resources Minister Seamus O’Regan said in an emailed statement.

“We intend to continue to operate the line and certainly we’re in compliance with the easement and the law,” Al Monaco, Enbridge’s chief executive officer, said on an earnings call Friday. “Courts are reviewing the state’s challenge to the pipeline and that’s going to take a while. So no decisions, in our view, are imminent.”

The dispute has soured relations between the U.S. and Canada three months after President Joe Biden, a Whitmer ally, angered Canadians by revoking a permit to the build cross-border Keystone XL pipeline. While the Keystone decision was disappointing, the continued operation of Line 5 is “nonnegotiable,” O’Regan said in an interview last month.

The state of Michigan “intends to assert claims for trespass and unjust enrichment” and if it wins, the company will have to disgorge its future Line 5 profits, Whitmer said in a letter to Enbridge on Tuesday.

Pipelines have become a major battlefront in the fight between the fossil fuel industry and environmentalists concerned about climate change and the impact of oil spills on waterways and indigenous communities. If Whitmer eventually gets her way, a Line 5 shutdown could mark the first time a major in-service oil pipeline is forced to shutter because of environmental concerns.

A U.S. judge isn’t expected to rule on whether the case belongs in state or federal court until later this year, so don’t expect the pipeline to stop operating any time soon, Matthew Taylor, an analyst at Tudor Pickering & Holt, said in a note. “We view a near-term shutdown unlikely,” he said.

Enbridge plans to address concern about Line 5 by building a tunnel under the straits to house a new pipeline. Should the existing one be shut, the company has some capacity on an alternate line that bypasses the Great Lakes “but it’s not going to make a difference,” Monaco said.

The governor’s order is unenforcible without a separate order by a judge and there is “no way that’s going to happen” by the May 12 deadline, Joe Comartin, Canada’s consul-general in Detroit, said by phone. What’s more, the case is already before a federal court; any decision supporting the governor’s move would would be appealed in a process that would take years.

On Wednesday, pro- and anti-Line 5 protesters are expected to gather in Michigan and there will probably be an exchange of harsh words between Enbridge and Whitmer, but nothing more, Comartin said. Even if the governor’s order were eventually upheld, Canada could invoke a 1970s-era treaty with the U.S. that prevents either government from blocking petroleum flows, he said.