A federal judge struck down Mississippi’s controversial law banning most abortions after 15 weeks about eight months after the Republican governor approved it.

The law, called the Gestational Age Act, was considered to be the most restrictive in the U.S. It banned abortions after 15 weeks and only allowed for exemptions if the pregnancy threatened a woman's life or "major bodily function" or if the fetus would be “incompatible with life” outside of the womb.

Exemptions would not be granted for pregnancies that resulted from rape or incest. Doctors who violated the ban would have faced mandatory suspension or revocation of their medical license.

U.S. District Judge Carlton Reeves ruled Tuesday that the law “unequivocally” violated women’s constitutional rights and contended there wasn’t “legitimate state interest strong enough, prior to viability, to justify a ban on abortions.”

“[T]his Court concludes that the Mississippi Legislature’s professed interest in ‘women’s health’ is pure gaslighting,” Reeves wrote in his decision.

Reeves also said the abortion ban was “closer to the old Mississippi – the Mississippi bent on controlling women and minorities.”

The confrontation began when Gov. Phil Bryant, a Republican, signed House Bill 1510 into law on March 19. Jackson Women’s Health Organization, the state’s only abortion clinic, sued, and Reeves issued a temporary restraining order. The clinic only provides abortions up to 16 weeks, according to The Clarion-Ledger.

ABORTION, ROE V. WADE AT CENTER OF SUPREME COURT NOMINEE DEBATE: WHAT COULD HAPPEN TO LANDMARK LAW?

The Center for Reproductive Rights, a national abortion-rights group, helped represent the Mississippi clinic in its legal battle.

“Our victory today means that women in Mississippi will maintain the ability to make their own decisions about whether and when to terminate a pregnancy,” Nancy Northup, president and CEO of the center, said in a statement after the ruling.

Current state law bans abortion after 20 weeks of a woman’s last period, according to The Clarion-Ledger.

Bryant’s office did not immediately respond to a request for comment Wednesday morning. According to The Associated Press, he was traveling on Tuesday.

After he signed the law in March, Bryant said he wanted Mississippi to be the “safest place in America for an unborn child.” Earlier this month, he also decried what he called “the genocide of over 20 million African-American children” in the U.S. since the landmark Supreme Court decision Roe v. Wade passed in 1973.

ABORTION DEBATE INTENSIFIES AFTER AMENDMENTS PASS REMOVING ABORTION PROTECTIONS IN 2 STATES

It’s unclear if Bryant plans to appeal the ruling.

But Reeves accused Mississippi of attempting to enact an “unconstitutional” law in an effort to “endorse a decades-long campaign, fueled by national interest groups, to ask the Supreme Court to overturn Roe v. Wade.”

“With the recent changes in the membership of the Supreme Court, it may be that the State believes divine providence covered the Capitol when it passed this legislation. Time will tell,” Reeves wrote. “If overturning Roe is the State’s desired result, the State will have to seek that relief from a higher court. For now, the United States Supreme Court has spoken.”

He also said it was a “sad irony” that men were involved in the decision-making about women’s reproductive health.

“The fact that men, myself included, are determining how women may choose to manage their reproductive health is a sad irony not lost on the Court,” Reeves wrote.

The Associated Press contributed to this report.