Enbridge Energy scored a legal victory Thursday, as the Michigan Court of Claims granted a summary judgment in Enbridge’s lawsuit against Gov. Gretchen Whitmer over her efforts to shut down the Line 5 oil and gas pipeline in the Straits of Mackinac.

The ruling by Judge Michael Kelly effectively reinstates the controversial Line 5 tunnel deal that Enbridge made with former Gov. Rick Snyder.

Michigan Attorney Dana Nessel quickly issued a statement saying the state will appeal the decision.

“We always anticipated that this matter would be resolved in the appellate courts, and we are more resolved than ever to continue this fight on behalf of the people of Michigan," the statement said.

In 22-page ruling, Kelly rejected the arguments offered by Whitmer and Nessel, who said the Republicans’ agreement with Enbridge violated the state constitution.

The Enbridge agreement was finalized with Snyder just days before he left office. It calls for Enbridge to construct and pay for a $500 million tunnel under the Straits that would house Line 5 and other utilities.

The deal also requires Enbridge to hand ownership of the tunnel over to a state oversight panel after it is completed.

Snyder’s tunnel deal was effectively scuttled after Nessel deemed the law underpinning the deal as unconstitutional. Whitmer halted all state work on the tunnel afterward and Enbridge filed suit in June when negotiations with Whitmer failed.

Nessel based on her opinion around the title-object clause, a part of the Michigan Constitution that states a bill shall have only one object, which shall be expressed in its title.

Nessel wrote that significant amendments to the legislation’s language transferring power over the tunnel from the Mackinac Bridge Authority to the Mackinac Straits Corridor Authority before it was signed into law as PA 359 meant the title didn’t match the bill.

“It is plain from the body of Act 359 that this transfer is a component of the central, and significantly different, purpose of the body of the act - authorizing the Corridor Authority to almost immediately enter into a specific type of agreement with a private party to acquire and operate a utility tunnel,” she wrote.

Nessel concluded in her opinion that “any court determination that Act 359 is unconstitutional would likely apply that decision retroactively, and conclude that the Mackinac Straits Corridor Authority, its Board, and any action taken by the Board are void from their inception.”

Kelly rejected those arguments, saying titles “should be construed reasonably, not narrowly and with unnecessary technicality.”

He wrote the court is required to be cautious in declaring laws to be unconstitutional, saying they only can be struck down "when invalidity appears so clearly as to leave no room for reasonable doubt that it violates some provision of the Constitution that a court will refuse to sustain its validity.”

Kelly added that his ruling is a narrow one, looking only at the issue of whether PA 359 is unconstitutional based on the the title-object issue raised by Nessel.

The issue “has generated strong views on whether the policy goals of PA 359 are sound,” Kelly wrote. "Those concerns are not the focus of the instant action and are best left to the Legislature. Indeed, a statute ‘is not unconstitutional merely because it appears undesirable, unfair, unjust, or inhumane nor because it appears that the statute is unwise or results in bad policy.’ "

Whitmer was pushing to shut down Line 5 within two years, something Enbridge officials said would cause a “serious disruption of the energy market in the state.”

A Line 5 replacement housed in a utility tunnel underneath the Straits wouldn’t be operational until 2024, the company has previously said. Whitmer previously said construction delays and potential litigation could delay that target by several years.

In a statement, Enbridge said it was pleased with the decision.

“Enbridge remains fully committed to the Great Lakes Tunnel project,” the statement said. “We continue to believe the tunnel is the best solution for Michigan and that Line 5 can continue to be safely operated during the period while the tunnel is being constructed. And we are committed to build it.”

But critics of Line 5 were dismayed.

“This ruling is scary for the Great Lakes," said Mike Shriberg, Great Lakes executive director for the National Wildlife Federation, in a written statement.

“The lame-duck tunnel scheme rushed through last year lacked a timeline for decommissioning the existing Line 5, providing a free pass for Enbridge to use the Great Lakes as a shortcut for as long as it wants while it purports to study the tunnel,” the statement said. "Whether the Court of Appeals eventually reverses this decision or not, without a timeline for shutting down the existing Line 5 any tunnel discussion is as illusory as a ghost.”

Shriberg served on Gov. Snyder’s Pipeline Safety Advisory Board, which opposed the Snyder/Enbridge deal last year.