(Reuters) – A federal judge temporarily blocked Arkansas from enforcing a recently passed ban on abortion for women who are more than 18 weeks pregnant, just minutes before the new law was to take effect on Wednesday.

U.S. District Judge Kristine Baker granted a temporary restraining order through Aug. 6, blocking the state from enforcing that ban and other restrictions that abortion-rights advocates said would have sharply reduced the number of medical doctors allowed to perform the abortions in the state.

“The record at this stage of the proceedings indicates that Arkansas women seeking abortions face an imminent threat to their constitutional rights,” Baker wrote in her 159-page order.

Arkansas is among a wave of Republican-controlled U.S. states that recently passed new restrictions on abortion.

Some of these measures — including Alabama’s outright ban making no exceptions for rape or incest — are aimed at prompting the newly enshrined 5-4 conservative majority on the U.S. Supreme Court to overturn the 1973 Roe v. Wade decision that upheld a woman’s right to terminate her pregnancy.

Abortion is one of the most divisive social issues in the United States, with opponents often citing religious beliefs to call it immoral while abortion-rights advocates say limiting access to it infringes on women’s rights to control their bodies.

The abortion-rights advocates, including the American Civil Liberties Union of Arkansas, who filed the suit on June 26, said they would seek to make the ruling permanent.

“We’re relieved that these bans and restrictions have been blocked from taking effect and we’re determined to see them struck down for good,” Holly Dickson, legal director and interim executive director of the ACLU of Arkansas, said in a statement.

Arkansas Attorney General Leslie Rutledge called the ruling “frustrating, but not unforeseen,” and said the state would continue to defend its abortion restrictions.

“The action was only the initial step and I anticipate further action in the near future in our defense of these laws that protect the life of mothers and their unborn children,” Rutledge said in a statement.

Besides the ban on abortions beyond 18 weeks of pregnancy, roughly the middle of the second trimester, the restrictions require that only Arkansas-licensed physicians who are board-certified or board eligible in obstetrics and gynecology may perform abortions.

The restrictions also bar women from having an abortion “solely on the basis” of tests indicating the fetus has Down syndrome.

(Reporting by Peter Szekely in New York; Editing by Scott Malone and Bernadette Baum)