MADISON, Wis. — The U.S. Supreme Court has ordered that Wisconsin’s so-called “cocaine mom” law remain in effect while an appeal to a judge’s ruling striking it down as unconstitutional is pending.

The court issued a stay Friday, agreeing to Wisconsin Attorney General Brad Schimel’s request. Schimel calls the decision “a victory for the rule of law” that “restores important tools that make mothers and children safer and stronger.”

The law permits the detention of pregnant women suspected of drug abuse but a federal judge in April ruled it was unconstitutionally vague. Schimel had argued that not allowing the law to remain in effect could have “disastrous consequences.”

Opponents of the law argue it discourages pregnant women struggling with addiction from seeking prenatal care, is vague and overly punitive.

Supreme Court Justices Ruth Bader Ginsburg and Sonia Sotomayor were against granting the stay.