A federal judge temporarily blocked an Arkansas law that would ban gender-transition surgery for minors, in a ruling on Wednesday.

The American Civil Liberties Union sued to scrap the law in May on behalf of four transgender youths and two doctors who provide gender-transition surgeries. The law, initially set to take effect on July 28, would revoke the medical licenses of doctors who administer gender-transition surgery or puberty blockers to minors.

U.S. District Judge Jay Moody of Little Rock granted a temporary injunction while the suit makes its way through the courts.

โ€œTo pull this care midstream from these patients, or minors, would cause irreparable harm,โ€ Moody said, in comments reported by the Associated Press.

The ACLU hailed the decision.

โ€œThis ruling sends a clear message to states across the country that gender affirming care is life-saving care, and we wonโ€™t let politicians in Arkansasโ€”or anywhere elseโ€”take it away,โ€ Holly Dickson, executive director of the ACLU of Arkansas, said in a statement.

Senator Tom Cotton (R., Ark.) commented that the decision went โ€œagainst the willโ€ of Arkansas residents.

โ€œOur legislature made the reasonable decision to protect minors from dangerous and life-altering drugs, hormones, and surgeries,โ€ Cotton said in a statement. โ€œAgainst the will of Arkansans, liberal activists have now put those children back in harmโ€™s way.โ€

After the Arkansas legislature passed the law earlier this year, Governor Asa Hutchinson, a Republican, vetoed the bill. The legislature subsequently overrode Hutchinsonโ€™s veto in early April.