A judge in Oklahoma on Monday blocked an attempt by the state’s Legislature to restrict access to morning-after birth control pills.

The federal government removed restrictions on the purchase of emergency contraceptives in June. The Oklahoma Legislature subsequently passed a law that required purchasers to show identification and, if age 17 or under, to have a prescription.

The Oklahoma law “would have essentially reimposed” the federal restrictions, said David Brown, staff lawyer for the Center for Reproductive Rights in New York, which sued on behalf of the Oklahoma Coalition for Reproductive Justice and Jo Ann Mangili, the mother of a teenage girl, to overturn the law.

Judge Lisa Davis of Oklahoma County issued a temporary injunction to block enforcement of the law until the case is decided.