On Tuesday, abortion rights advocates filed a lawsuit in an Iowa district court seeking to block Iowa’s newest abortion law. It bans most abortions at about the sixth week of pregnancy, before many women know they are pregnant.

Known as “the heartbeat bill,” the law would ban abortions as soon as embryonic cardiac activity is detected. The bill was signed into law by Gov. Kim Reynolds (R) after passing the Iowa House and state Senate earlier this month. Unless blocked, the Iowa law would go into effect July 1.

The ACLU of Iowa, the Planned Parenthood Federation of America and the Emma Goldman Clinic of Iowa City are plaintiffs in the lawsuit challenging Iowa’s law. The case was filed in Polk County District Court.

Almost immediately after the lawsuit was filed, the state’s attorney general said he would not defend the new law. Democrat Tom Miller said he based his decision on a belief that the measure “would undermine rights and protections for women,” the Associated Press reported.

The lawsuit names Reynolds, the state’s governor, and the Iowa Board of Medicine as defendants.

If the ban takes effect, Iowa women would have to travel out of state to obtain an abortion after a fetal heartbeat is detected.

The law allows for some exceptions, including in the case of a “medical emergency,” such as conditions that are life-threatening or pose “a serious risk of substantial and irreversible impairment of a major bodily function.” There is an exception for rape and incest, which requires women to report the crime to law enforcement or certain medical professionals within 45 days.

Doctors who violate the law would lose their licenses. The law does not allow a woman to access an abortion because of “psychological conditions, emotional conditions, familial conditions, or the woman’s age.”

Abortion rights advocates say those who don’t have the resources to leave Iowa will be forced to carry an unwanted pregnancy to term, or in some cases will attempt to self-induce, a sometimes-dangerous act.

Jill Meadows, medical director of Planned Parenthood of the Heartland and a co-plaintiff in the lawsuit, said it is important that the law not go into effect: “Abortion care must remain safe and legal as an important part of basic reproductive health care.”

Rita Bettis, the legal director of the ACLU of Iowa, said Iowa’s “abortion ban is beyond extreme.”

“With it, Iowa politicians have tried to ban virtually all abortions for women in our state,” Bettis said. “In the 45 years since [Roe vs. Wade], no federal or state court has upheld such a dangerous law.”

The Iowa law is part of a flurry of legislation that aims to test the legality of abortion restrictions, as some Republicans want legal challenges to the laws to reach the U.S. Supreme Court in an effort to overturn its landmark 1973 Roe v. Wade ruling. In Mississippi this year, GOP lawmakers passed a 15-week abortion ban that was signed by Mississippi’s Republican governor, but the law was quickly put on hold after a court challenge.

In the midterms, where did antiabortion activists win — and where did they lose?

Antiabortion measures passed in these two states, but were defeated in another

Why women’s rights have been dividing American politics since the 1970s

Everything changed once the personal became the political

Dr. Leana Wen, Baltimore’s health commissioner, will be the next president of Planned Parenthood

Here’s what that means for the future of the organization