The Kansas Supreme Court ruled Friday that the state’s constitution enshrines a woman’s right to an abortion, guaranteeing that the procedure would remain available there even if Roe v. Wade is overturned.

The 6-1 ruling determined that the state’s Bill of Rights “allows a woman to make her own decisions regarding her body, health, family formation, and family life — decisions that can include whether to continue a pregnancy.” The court derived its conclusion from one of the most familiar lines in the the Declaration of Independence and state constitutions: that people have the right to “life, liberty, and the pursuit of happiness.”

The Kansas court took up the issue after two abortion providers in the state challenged a broad ban on dilation and evacuation abortions, known commonly as D&Es, in 2015 that the legislature had passed that year. Kansas was the first state to place limits on the procedure, which is used for nearly all second-trimester abortions.

While a district judge blocked the ban from going into effect, the case worked its way through the judicial system until it landed before the state Supreme Court in 2017. The court took an unusually long time to decide the case and announced its decision Friday in a nearly 200-page decree.

It includes a powerful passage directed at the sole dissent from Justice Caleb Stegall.

“We are struck by the ease with which the dissent ignores the importance of this natural right and the consequences women would face if we did not recognize the founders’ intent to protect it from an overreaching government,” the other justices wrote.

Particularly concerning, they said, is Stegall’s emphasis on the “graphic details of the D&E” procedures, which are performed in only a small percentage of abortions overall.

“By avoiding any other aspect of the lives of pregnant women, the dissent appears to maintain that upon becoming pregnant, women relinquish virtually all rights of personal sovereignty in favor of the Legislature’s determination of what is in the common good,” they continued.

Pro-choice groups applauded Friday’s decision, emphasizing the protection it offers women in Kansas if Roe v. Wade is overturned.

The executive director of the anti-abortion group Kansans For Life, Mary Kay Culp, told The Federalist that the decision is a “horrendous ruling” based on the court’s “false claim that there exists a ‘right to abortion.’”

The decision in Kansas comes as several other state legislatures pursue “heartbeat bills” that seek to ban abortion as soon as a doctor can measure cardiac activity in a fetus, usually around six weeks into a pregnancy.

Governors in Mississippi and Kentucky both recently signed such bills into law, though they will likely face legal challenges. Similar bills are also in play in Florida, Missouri, Georgia, Ohio, Tennessee and Texas.

CORRECTION: A previous version of this story misstated which historical document the statement “life, liberty, and the pursuit of happiness” could be found in.