A divided federal appeals court panel ruled Friday that Ohio cannot enforce a 2017 law banning abortions when medical tests show the baby has Down syndrome.

The 6th Circuit Court of Appeals in Cincinnati upheld a preliminary injunction saying that the law was invalid because it had the purpose and effect of preventing some women from obtaining pre-viability abortions, which violates Supreme Court precedents.

Signed into law by then-Gov. John Kasich in 2017, the measure imposed criminal penalties on doctors who perform abortions after learning of a fetal diagnosis of Down syndrome.

In February 2018, the American Civil Liberties Union of Ohio filed suit to block the law from taking effect. One month later, U.S. District Court Judge Timothy S. Black halted the law, saying it violated a woman’s right to privacy.

TRUMP TO NAME STATE DEPT. OFFICIAL JOHN SULLIVAN AS NEXT AMBASSADOR TO RUSSIA

On Friday the panel of three judges upheld Black’s ruling in a 2-1 decision. A spokesman for Republican Attorney General Dave Yost said the state will ask the full 6th Circuit to review the case, according to Reuters. A large majority of the 6th Circuit court's members were appointed by Republican presidents, but Friday's majority consisted of Democratic appointees.

"The state’s interest in preventing discrimination does not become compelling until viability," wrote Circuit Judge Bernice Bouie Donald, appointed by the Obama administration.

Circuit Judge Alice Moore Batchelder, appointed by former President George H.W. Bush, dissented.

“Ohio concluded that permitting physicians to become witting accomplices to the deliberate targeting of Down syndrome babies would undermine the principle that the Down syndrome population is equal in value and dignity to the rest of Ohio’s population," Batchelder wrote, according to Cincinnati.com.

BETO THREATENS TAX-EXEMPT STATUS OF CHURCHES IF THEY DON'T SUPPORT GAY MARRIAGE

Batchelder, quoting a May opinion from Supreme Court Justice Clarence Thomas, added that states have a “compelling interest in preventing abortion from becoming a tool of modern-day eugenics.”

Under the law, doctors could have received up to 18 months in prison for performing abortions with the knowledge that the mother had based her decision in part on a prenatal diagnosis of Down syndrome.

CLICK HERE TO GET THE FOX NEWS APP

The Down syndrome bill was the latest Ohio abortion law to receive a setback from the courts. In July, a federal judge blocked Ohio from enforcing a fetal “heartbeat” law banning abortions after a heartbeat was detected, or six weeks at the earliest.

A ban on abortions by dilation and evacuation, a surgical procedure most commonly used in second-trimester abortions, has also been challenged in court.