The American Civil Liberties Union and Planned Parenthood filed a lawsuit Friday morning to challenge Alabama's near-total abortion ban, which was signed into law by Gov. Kay Ivey last week. The law has not yet gone into effect.

The legislation — House Bill 314, the "Human Life Protection Act" — bans all abortions in the state except when "abortion is necessary in order to prevent a serious health risk" to the woman, according to the bill's text. It criminalizes the procedure, reclassifying abortion as a Class A felony, punishable by up to 99 years in prison for doctors who perform an abortion.

The legislation makes no exceptions for victims or rape or incest.

Get Breaking News Delivered to Your Inbox Click here to view related media. click to expand

The lawsuit follows a week of nationwide protests against the recent wave of anti-abortion legislation passed in Alabama and other states. More than 400 rallies were held coast-to-coast Tuesday in support of abortion rights.

"We've been clear: If you attack our constitutional right to reproductive freedom, we will sue," the ACLU wrote on Twitter. Planned Parenthood tweeted, "along with our partners at @ACLUAlabama, we just filed a lawsuit, challenging Alabama's outright abortion ban. We meant it when we said we'd see you in court, @GovernorKayIvey."

BREAKING: We just filed our lawsuit to stop Alabama's abortion ban from ever going into effect. pic.twitter.com/o3j25NsaHM — ACLU (@ACLU) May 24, 2019

BREAKING: along with our partners at @ACLUAlabama, we just filed a lawsuit, challenging Alabama's outright abortion ban. We meant it when we said we'd see you in court, @GovernorKayIvey. #alpolitics #hb314 #stopthebans — Planned Parenthood Southeast Advocates (@PPSE_Advocates) May 24, 2019

"Alabama's state motto is audemus jura nostra defendere, which means 'we dare defend our rights.' That's exactly what we're doing here today," Staci Fox, president and CEO of Planned Parenthood Southeast, said in a statement. "Abortion has been safe and legal in this country for more than 45 years and we aim to keep it that way."

The lawsuit reads: "By criminalizing the performance of an abortion (or attempted performance of an abortion) at all points in pregnancy, H.B. 314 directly conflicts with Roe and more than four decades of Supreme Court precedent affirming its central holding."

Alabama's near-total ban is among the most extreme state-level anti-abortion measures enacted in defiance of Roe v. Wade, the Supreme Court's landmark 1973 ruling that protects a woman's right to the procedure. Supporters of the legislation hope the case will be taken up by the Supreme Court and that the justices will use it to overturn Roe.

In previous years the Supreme Court declined to hear such cases. But a new ideological makeup on the nation's highest court, including the recent appointment of conservative Justice Brett Kavanaugh, has emboldened anti-abortion activists to try again.

Georgia, Kentucky, Mississippi and Ohio have also passed laws that prohibit abortion when a fetal heartbeat is detected at around six weeks — before many women know they are pregnant. None of the laws have taken effect, and all are expected to be blocked while legal challenges work their way through the courts.

The ACLU and Planned Parenthood also filed a lawsuit against Ohio's "heartbeat" bill, which is slated to take effect on July 10.

"Make no mistake: Abortion remains — and will remain — safe and legal in Alabama. With this lawsuit, we are seeking a court order to make sure this law never takes effect," said Randall Marshall, executive director of the ACLU of Alabama. "We hope our state's elected leaders take note and stop using taxpayer dollars on a legal gamble that they know is unconstitutional and unenforceable."