A judge will temporarily block the most restrictive abortion law in the country from taking effect in Iowa next month under an agreement between lawyers for the state and abortion rights groups.

Attorneys for the state and Republican governor Kim Reynolds agreed Friday to prevent the law from taking effect on 1 July after discussions with the American Civil Liberties Union of Iowa, Planned Parenthood Federation of America and the Emma Goldman clinic, a women’s reproductive health facility in Iowa City.

The advocacy groups have sued the state to block the law, which was passed by the legislature in early May and instantly became the most restrictive abortion regulation in the country. Controversially, the new law bans most abortions if a fetal heartbeat can be detected – as early as six weeks, before many women even know they are pregnant.

The new law is as part of the conservative crusade across the country, but especially in the heartland and the south, to fight against abortion rights incrementally, with the aim of eventually getting a case up to the supreme court in the hope that it would overturn the landmark Roe v Wade decision that legalized abortion in the US in 1973.

Reproductive rights advocates hope that the state’s extreme stance will drive female voters to the polls in support of pro-choice candidates. But they also fear that Trump’s conversion to an anti-choice platform, combined with the potential for him to stack the courts with ultra-conservative judges, bodes ill access to abortion, both surgical and the pill method, and to birth control.

An attorney for the state of Iowa said on Friday the administration hoped quickly to get the case before a judge in order to argue that the new law is constitutional.

Judge Michael Huppert said during a court hearing on Friday morning that he’ll issue a temporary injunction later in the day.

Reynolds signed the law on 2 May, two days after lawmakers in the Republican-dominated legislature approved it.