A Michigan court is ordering Canadian energy firm Enbridge to temporarily shut down operation of its Line 5 pipeline in the Straits of Mackinac.

The 67-year-old pipeline carries up to 23 million gallons of oil and natural gas liquids from Superior to Sarnia, Ontario. It splits into two 20-inch pipelines for roughly four miles under the straits connecting Lakes Michigan and Huron.

The dual pipelines were shut down one week ago after the company discovered an anchor support had shifted position, but Enbridge resumed operation of the west leg of Line 5 on Saturday afternoon after it said damage was isolated to the east segment of the pipeline.  

On Monday, Michigan Attorney General Dana Nessel filed a motion in Ingham County Circuit Court for a temporary restraining order requiring Enbridge to cease all operation of Line 5 and provide information on the damage. In a six-page ruling Thursday, Judge James S. Jamo granted Nessel's request.

The judge ruled Enbridge failed to provide sufficient documentation about the safety of resuming operations on the west leg of the pipeline, as well as the nature and cause of the damage to Line 5.

Enbridge has argued that it can safely operate the west segment of Line 5.

If the company is wrong, Jamo wrote that the risk "is so substantial and irreparable, and endangers so many communities and livelihoods and the natural resources of Michigan, the danger far exceeds the risk of financial loss" to the company. 

Enbridge must temporarily shut down Line 5 in the Straits within 24 hours of receiving the court's order. The company may not resume operation until at least Tuesday, when a hearing is scheduled to take up the matter.

Michigan's attorney general said in a statement that it's grateful for the court's decision.

"While the fact that Enbridge reactivated one of the lines before consulting with the State is concerning, the fact that the company has failed to disclose the cause of this damage is equally alarming, considering the impact a breach in the pipeline could have to our state residents and economy," wrote Nessel. 

Nessel said the ruling was a "short-term fix" and that the state would continue to work to remove Line 5 from the lake bed. 

Michigan Gov. Gretchen Whitmer's office said in a statement that Enbridge's decision to resume operations following the damage to Line 5 was "reckless and unacceptable."

"Enbridge owes a duty to the people of Michigan and must answer to the state for how it treats our Great Lakes," said Tiffany Brown, the governor's spokesperson. "The governor will continue working to keep our water safe."

Enbridge did not immediately respond to a request for comment on Thursday afternoon.

On Monday, the company said the temporary restraining order was "vigorously opposed" by Enbridge. The energy firm said it's been working closely with the Pipeline and Hazardous Materials Safety Administration, a federal agency that operates as part of the U.S. Department of Transportation, to ensure the safety of its pipelines. 

In the ruling, Jamo said Enbridge failed to adequately document its involvement and communications with the federal regulator for the court.

Enbridge has said Line 5 is a vital source of energy for Michigan and surrounding areas and has operated the pipeline safely in the Great Lakes since 1953. 

Environmental groups like the National Wildlife Federation have pointed to spills that have taken place on the land-based portion of Line 5, as well as the company's 2010 release of more than 843,000 gallons of oil into Michigan's Kalamazoo River, as examples of the danger posed by the company's pipelines.

Enbridge has said it has spent billions in safety and technology upgrades since then to improve the integrity of its pipelines.