CNN  — 

The Supreme Court on Thursday cleared the way for Kentucky’s Republican attorney general to step in to defend a controversial abortion law, after the Democratic governor declined to continue doing so.

The law restricts a standard second-trimester abortion method known as “dilation and evacuation” that is used after 15 weeks of pregnancy. It was signed into law in 2018 but has so far been blocked by the courts.

The Supreme Court’s ruling doesn’t address the constitutionality of the law. Instead, the dispute involved a procedural issue: whether the attorney general could step in to defend the law after other state officials said they would no longer pursue an appeal.

The court’s 8-1 decision revives the case at hand and will make it easier for states that elect their attorneys general to defend laws when a state official from an opposing party has a different viewpoint.

Justice Samuel Alito, writing for the majority, said that the federal appeals court should not have ruled that the attorney general was unable to intervene to defend the law. He said “a State’s opportunity to defend its laws in federal court should not be lightly cut off.”

Thursday’s opinion comes as the justices allowed Texas’ strict six-week abortion ban to remain in effect and as they are considering the future of Roe v. Wade in a case concerning a restrictive abortion law in Mississippi.

The decision wasn’t a complete surprise because during oral arguments last month in a case that raised some similar legal issues, Justice Stephen Breyer accidentally gave away the result of the Kentucky case even before the opinion had been released.

Kentucky is one of several states where attorneys general are elected – giving rise to potential conflicts if the governor of a state is of a different party. Abortion providers expressed concern that it the state’s attorney general in the case at hand prevailed, the legal dispute would continue.

Complicated procedural background

The Kentucky abortion law was signed in 2018 by Gov. Matt Bevin, a Republican, and immediately challenged by EMW Women’s Surgical Center and two of its doctors. They argued the law imposed an undue burden on the right to pre-viability abortion.

Then-Attorney General Andy Beshear, a Democrat, said his office did not have the authority to defend the law and he agreed to be bound by the decision of the state’s secretary of health.

After a five-day bench trial, a district court blocked the law, and the case went to the federal appeals court. At the same time, however, an election occurred and Beshear became governor. In the same election, Republican Daniel Cameron was elected attorney general.

After an appeals court affirmed the district court’s decision, the divide between the parties opened: Beshear’s administration said it would not appeal the decision.

That prompted Cameron to intervene in the case, attempting to revive the dispute, only to lose when the federal appeals court said his request came too late. The lower court emphasized that the office of the attorney general had already agreed to step out of the case, and now it was too late to try to step back in.

Cameron appealed to the Supreme Court. Kentucky’s Principal Deputy Solicitor General Matthew Kuhn told the justices that as a matter of Kentucky law, Cameron has the final say on whether to accept a decision that enjoined a state law, and that even under the previous attorney general, the office had preserved the ability of the attorney general to “participate in any appeal.”

He said Cameron “had the ability to protect Kentucky’s interests when it became unrepresented” and that the decision to defend the law represented a “hand off” from one state official to another.

Writing in dissent on Thursday, Justice Sonia Sotomayor, one of the court’s liberal members, said the appeals court had come to the right conclusion.

“In every case, there must be a point of time when litigation shall be at an end,” she wrote. She said she feared her colleagues’ decision would “open the floodgates for government officials to evade the consequences of litigation decisions made by their predecessors of different political parties undermining finality and upsetting the settled expectations of courts, litigants, and the public alike.”

In court, Alexa Kolbi-Molinas, an attorney with the American Civil Liberties Union, stressed that the office of attorney general had already spoken on the law during an earlier phase of the proceedings and that Cameron stands in the “shoes of his predecessor.”

“Intervention is not a revolving door,” she said, and added that the lower court did not abuse its discretion by holding that Cameron’s attempt to get into the case came too late.

This story has been updated with additional details Thursday.

CNN’s Devan Cole contributed to this report.