The Iowa State Supreme Court on Friday temporarily halted part of a state law that banned most abortions after 20 weeks of pregnancy.

The Republican-controlled state legislature passed the law in April, outlawing most abortions after 20 weeks and requiring a 72-hour waiting period before an abortion procedure could take place, including in instances of incest and rape. It grants exceptions if a mother’s life or health was at risk.

The court’s emergency temporary injunction came two hours after the law was signed by Iowa Gov. Terry Branstad. The legal challenge was brought by the American Civil Liberties Union and Planned Parenthood, which disputed the law’s three-day waiting period and a stipulation that women must make an additional clinical appointment before receiving an abortion. The challenge was denied by a lower court on Thursday before reaching the state Supreme Court a day later.

Planned Parenthood of the Heartland chief executive officer Suzanna de Baca lauded the decision and noted that the law had created confusion and barriers for women seeking abortions.

“We are pleased that the court granted the temporary injunction, ruling on the side of Iowa women who need access to, and have a constitutional right, to safe, legal abortion,” she said in a statement.

A spokesperson for Branstad said court challenges to the law were expected. However, Republican state Sen. Mark Costello, who favored the law, said he expected it would be upheld.

“It’s one of the reasons we went with this bill, which was somewhat more limited than what a lot of people wanted,” he said. “We felt it would be upheld.”

Seventeen states ban abortion after 20 weeks, while five other states — Missouri, North Carolina, Oklahoma, South Dakota and Utah — require the 72-hour waiting period, except in cases of a medical emergency, according to the Guttmacher Institute.