ATLANTA (AP) – A judge overturned Georgia’s ban on abortion starting around six weeks into a pregnancy, ruling Tuesday that it violated the U.S. Constitution and U.S. Supreme Court precedent when it was enacted.

Fulton County Superior Court Judge Robert McBurney’s ruling applies statewide. The ban had been in effect since July.

It prohibited most abortions once a “detectable human heartbeat” is present. Cardiac activity can be detected by ultrasound in cells within an embryo that will eventually become the heart as early as six weeks into a pregnancy. That means most abortions in Georgia were effectively banned at a point before many women knew they were pregnant.

McBurney’s ruling came in a lawsuit that sought to strike down the ban on multiple grounds, including that it violates the Georgia Constitution’s right to privacy and liberty by forcing pregnancy and childbirth on women in the state. The lawsuit filed by doctors and advocacy groups in July also argued that Georgia’s abortion ban was invalid because it violated the U.S. Constitution and U.S. Supreme Court precedent when it was enacted.

McBurney agreed with that argument in his decision.

Georgia’s law was passed by state lawmakers and signed by Republican Gov. Brian Kemp in 2019 but had been blocked from taking effect until the Supreme Court overturned Roe v. Wade, which had protected the right to an abortion for nearly 50 years. The 11th U.S. Circuit Court of Appeals allowed Georgia to begin enforcing its abortion law just over three weeks after the high court’s decision in June.

McBurney said when the law was enacted, “everywhere in America, including Georgia, it was unequivocally unconstitutional for governments – federal, state, or local – to ban abortions before viability.”

He said the state’s law “did not become the law of Georgia when it was enacted and it is not the law of Georgia now.”

The state has argued that the Roe decision itself was wrong and the Supreme Court ruling wiped it out of existence.