The U.S. Supreme Court on Wednesday sided with Michigan in ruling that the state’s lawsuit seeking to shut down a section of an aging pipeline beneath a Great Lakes channel will stay in state court.

Justice Sonia Sotomayor wrote for a unanimous court that Enbridge, a Calgary-based energy company, waited too long to try to move the case to federal court.

The case is part of a messy legal dispute about a pipeline that has moved crude oil and natural gas liquids between Superior, Wis., and Sarnia, Ont., since 1953.

The pipeline at issue is called Line 5. Concerns over the section beneath the straits rupturing and causing a catastrophic spill have been growing since 2017, when Enbridge engineers revealed they had known about gaps in the section’s protective coating since 2014. A boat anchor damaged the section in 2018, intensifying fears of a spill.

The Michigan Department of Natural Resources under Gov. Gretchen Whitmer, a Democrat, revoked the straits easement for Line 5 in 2020. Enbridge has filed a separate federal lawsuit challenging the revocation.