A federal judge has blocked an Indiana law that would prohibit a woman from getting an abortion due to genetic birth defects like Down syndrome, or the ancestry or sex of the fetus.

U.S. District Judge Tanya Walton Pratt on Thursday granted a preliminary injunction sought by Planned Parenthood of Indiana and Kentucky to prevent the regulation from taking effect Friday on the grounds the law was unconstitutional and invaded women's privacy.

Pratt’s order cited Monday’s major U.S. Supreme Court ruling that struck down restrictions in a Texas abortion law.

Indiana Gov. Mike Pence (R) in March signed a controversial law that imposed new regulations and restrictions on abortion, including a so-called anti-discrimination clause. Indiana and North Dakota are the only states that have laws banning abortion for issues like genetic abnormality.

The law prohibited an abortion if the woman sought it based on the sex, race or ethnicity of the fetus, or if the fetus had a genetic abnormality or disability.

"The State’s theory is also contrary to the reality that the decision to terminate a pregnancy involves 'intimate views with infinite variations,'" Pratt wrote in her order.

She continued: "For example, PPINK points out, 'under the State’s theory there would be no constitutional protection for a woman who decides because of a loss of a job, dissolution of a marriage, illness of another child, personal illness, or the eruption of violence within the home, that she must end her pregnancy.'"

PPINK applauded the order Thursday.

“This cruel law painted a grim picture for Indiana women with its blatant, unwelcome intrusion into private, independent decision making," Betty Cockrum, president and CEO of PPINK, said in a statement.

Indiana University joined the PPINK lawsuit over a provision of the law that sought to control how fetal tissue was transferred and disposed of.

The university, which conducts research on conditions like autism and Alzheimer's using fetal tissue, argued that a professor transferring out of state with their research would be unable to do so without committing a felony under the law.

The judge concludes the state's argument of "treating fetal remains with the dignity of human remains" was not legitimate "given that the law does not recognize a fetus as a person."