A federal judge on Wednesday blocked Idaho from enforcing its near total ban on abortion where it conflicts with a federal law requiring hospitals to provide stabilizing care in a medical emergency, giving the Justice Department a victory in its first abortion challenge following the demise of two key abortion precedents.

Senior U.S. District Judge B. Lynn Winmill ruled Idaho’s law, which is set to take effect on Thursday, clashes in some cases with the federal Emergency Medical Treatment and Active Labor Act, known as EMTALA, which requires hospitals accepting Medicare funding to offer emergency care to all patients. He granted DOJ’s request for a preliminary injunction to halt enforcement of the law only in those limited circumstances.