A group of high school students in the Chicago area walked out of class Monday after being told they had to wear masks to attend class. 

The walkout came after Sangamon County Circuit Court Judge Raylene Grischow issued a temporary restraining order against Illinois Gov. J.B. Pritzker’s requirement that masks be worn in schools to prevent the spread of COVID-19

Video shared on Twitter by Jon J. Kerr, publisher of The Kerr Report on Substack, shows a throng of maskless Vernon Hills High School students trickling out of the school. 

school mask mandates

Libertyville High School students who refused to wear masks were told they had to stay in the gym or go home. (Annette Letang provided)

Community High School District 128 told Fox News that students who refused to wear masks met with their principals and were given the opportunity to explain their position and ask questions. 

The district, which includes Libertyville and Vernon Hills High School, said students were given three options Monday: put on a mask to attend class, leave school and have a parent report the absence, or stay in the gym and complete classwork." 

NEW YORK CHEERLEADERS PROTESTING COVID-19 VACCINE REQUIREMENTS AT HS CHAMPIONSHIPS

Many parents decried the district's decision to keep the mask mandate in place. Several parents who spoke to Fox News said their kids were left in the gym all day with nothing to do. 

"For two years, we have been living under mandates," Libertyville parent Socrates Vela told Fox News. "My wife and I did not serve in the Army so 20 years later, Illinois bureaucrats could strip our children's rights." 

Another parent, Kim Bissing, told Fox News she was "proud of students in District 128 today who chose to go against the school's unconstitutional mask mandate." 

"This is a learning opportunity for them to understand how our government works and when the system has failed, that you must speak up and let your voice be heard.," she said. 

The district signaled over the weekend that it would still be enforcing the mask mandate – except for the named student plaintiffs in a lawsuit filed by more than 700 parents at nearly 150 school districts across the state. 

The district said the mask mandate has allowed both schools to remain open for in-person learning and extracurricular activities. 

Lori Lightfoot

Chicago Mayor Lori Lightfoot and Illinois Gov. J.B. Pritzker greet Vice President Kamala Harris as she arrives in Chicago on April 6, 2021. (AP Photo/Jacquelyn Martin)

Later Monday, Democratic Attorney General Kwame Raoul asked the 4th District Appellate Court in Springfield for an emergency halt to Grischow’s temporary restraining order. 

CALIFORNIA'S INDOOR MASK MANDATE WILL END NEXT WEEK FOR VACCINATED INDIVIDUALS, GOV. NEWSOM SAYS

"Absent a stay, students, teachers, and other school employees will be further exposed to COVID-19, leading to additional and likely widespread transmission within schools and in the broader community, increased hospitalizations and deaths, and school staff shortages requiring full remote learning or even school closures," the appeal stated. 

Judge Grischow ruled Friday that the Democratic governor had overstepped his authority in an emergency order that had required students and staff to wear face coverings. She nixed other orders too, including one mandating vaccinations for school employees. 

She agreed with the plaintiffs that students may not be excluded from school for health reasons without family consent or a public health quarantine order. 

In a news conference Monday, Pritzker said the ruling was "out of step with the vast majority of legal analysis." 

Illinois Gov. J.B. Pritzker

Illinois Gov. J.B. Pritzker speaks during a ceremonial groundbreaking at the Obama Presidential Center in Jackson Park in Chicago. (Scott Olson/Getty Images)

"Most importantly, it constrains the ability of the named school districts to maintain safe in-person learning requirements," Pritzker continued. "The judge's decision cultivates chaos for parents, families, teachers and school administrators. ... Wearing masks has never been about what was required by the governor or any other authority. Masks, for most people anyway, have been about doing what's right."

CLICK HERE TO GET THE FOX NEWS APP

Grischow's ruling on the mask mandate affected more than 150 school districts, prompting varied reactions. At least two — St. Charles Community Unit School District 303 and Geneva Community Unit School District 304 — reacted with an emergency closure Monday. Chicago Public Schools, meanwhile, said it would continue to enforce its mask mandate.

The Associated Press contributed to this report