HAMPTON ROADS, Va. (WAVY) — A federal judge has issued a preliminary injunction in favor of a dozen Virginia families with immunocompromised students who said Virginia’s masks-optional state law makes their kids unsafe.

Click here to subscribe to WAVY’s breaking news email alert

According to the lawsuit filed in federal court in February, the families argued that the new Virginia state law banning universal masking in schools violates the Americans with Disabilities Act.

A federal judge agreed, but the new state law that allows districts to keep masking optional will stay in effect, according to the ruling.

The families however can now petition their schools or school districts to require masks, and the state cannot stop the specific schools from implementing some required masking.

United States District Judge Norman K. Moon said that federal law “requires that schools be able to consider and afford disabled students reasonable modifications from otherwise applicable state or local laws.”

The schools can choose to comply without being penalized by the state, but they are not required to, Moon said.

Three students, from Grassfield Elementary School and Southeastern Elementary School in Chesapeake and Tabb Middle School in York County are plaintiffs in the lawsuit.

There is no word yet on if these requests will be made.

Virginia Attorney General Jason Miyares was pleased that the ruling allows schools to keep masking optional if they choose to do so.

“Today’s ruling affirms that Governor Youngkin’s Executive Order 2 and Senate Bill 739 is the law of Virginia and parents have the right to make choices for their children.” said Attorney General Jason Miyares.

Related: Youngkin signs bill making masks optional for schools by March 1

Stay tuned to WAVY.com for updates.