Iowa schools can now enforce mask mandates for students as a federal judge on Monday ordered the state to immediately halt enforcement of a law passed in May that prevents school boards from doing the same.

Judge Robert Pratt said in an order signed on Monday that the law substantially increases the risk of several children with health conditions of contracting COVID-19, the Associated Press reported.

Pratt said he has looked at data on the effectiveness of masks to reduce the spread of the virus and agrees with recommendations from the Centers for Disease Control and Prevention and the American Academy of Pediatrics on mask-wearing in schools.

"Because Plaintiffs have shown that Iowa Code section 280.31's ban on mask mandates in schools substantially increases their risk of contracting the virus that causes COVID-19 and that due to their various medical conditions they are at an increased risk of severe illness or death, Plaintiffs have demonstrated that irreparable harm exists," the judge wrote in the order.

The order bars Governor Kim Reynolds and the Iowa Department of Education Director Ann Lebo from enforcing the new law that bans local school districts from using their discretion to mandate masks for students, staff, teachers and visitors.

The judge issued a temporary restraining order regarding the same that will come into effect immediately. The order will remain in effect until the court issues an order for a preliminary injunction.

Several parents and The Arc of Iowa, a group that defends the civil rights of people with intellectual and developmental disabilities sued the state.

Similar judgment had come from Florida when a judge had barred Governor Gavin Newsom to enforce mask mandate ban in the state of Florida. The mask mandate ban was reinstated following a US court ruling on Friday, according to US media reports. The ban restricts schools to mandate face masks for students on campus.