ATLANTA -- 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 and was therefore void.

Fulton County Superior Court Judge Robert McBurney's ruling took effect immediately statewide, though the state attorney general's office said it planned to appeal. The ban had been in effect since July.

It prohibited most abortions once a "detectable human heartbeat" was 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 filed in July by doctors and advocacy groups 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. McBurney did not rule on that claim.

Instead, his decision agreed with a different argument made in the lawsuit -- that the ban was invalid because it violated the U.S. Constitution and U.S. Supreme Court precedent at the time it became law.

Kara Richardson, a spokesperson for Georgia Attorney General Chris Carr, said in an email that the office intends to pursue an "immediate appeal."

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.

Abortion clinics in the state remained open, but providers said they were turning many women away because cardiac activity had been detected. Those women could then either travel to another state for an abortion or continue with their pregnancies.

During a two-day trial in October, abortion providers told McBurney the ban was causing distress to women denied the procedure and confusion among doctors.

McBurney wrote in his ruling that 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 wrote that 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 had argued that the Roe decision itself was wrong and the Supreme Court ruling wiped it out of existence.

McBurney did leave the door open for the state Legislature to revisit the ban.

Now that the Supreme Court has overturned Roe v. Wade, the prohibition on abortions provided for in the 2019 law "may someday become the law of Georgia," he wrote.

But, he wrote, that can happen only after the General Assembly "determines in the sharp glare of public attention that will undoubtedly and properly attend such an important and consequential debate whether the rights of unborn children justify such a restriction on women's right to bodily autonomy and privacy."

Georgia's ban included exceptions for rape and incest, as long as a police report was filed, and allowed for later abortions when the mother's life was at risk or a serious medical condition rendered a fetus unviable.

At the October trial, witnesses for the state disputed the claim that the law was unclear about when doctors could intervene to perform a later abortion. They also argued that abortions themselves could harm women.

Abortion was a central issue in Georgia's U.S. Senate contest between Democrat Raphael Warnock and Republican Herschel Walker, which is now headed to a runoff in December. Two women accused Walker, who opposes abortion, of paying for them to have the procedure. Walker vehemently denied that.

------

Associated Press writer Kate Brumback contributed to this report.