Students in northern Virginia schools will have to continue wearing face masks after an Arlington judge granted a temporary restraining order preventing Gov. Glenn Youngkin's mask-optional order from taking effect.

The decision comes after seven school boards requested a temporary restraining order in a lawsuit to block Youngkin's order which allows parents to decide what's best for their children.

Glenn Youngkin, governor of Virginia, speaks to members of the media following a cabinet swearing-in ceremony at the Virginia Executive Mansion, in Richmond, Virginia, U.S., on Saturday, Jan. 15, 2022. Youngkin, former co-CEO of the Carlyle Group Inc., is the first Republican elected to the office since 2009. Photographer: Al Drago/Bloomberg

Glenn Youngkin, governor of Virginia, speaks to members of the media following a cabinet swearing-in ceremony at the Virginia Executive Mansion, in Richmond, Virginia, U.S., on Saturday, Jan. 15, 2022. (Photographer: Al Drago/Bloomberg via Getty Images)

YOUNGKIN RESPONDS TO SCHOOL MASK MANDATE PUSHBACK FROM VIRGINIA SCHOOLS

"Having addressed all aspects of whether a temporary restraining order should issue, the Court concludes that the School Boards’ Motion for a Temporary Restraining Order with regard to optional masking of children should be granted," Arlington Circuit Court Judge Louise DiMatteo wrote in a Friday ruling. "To the extent that the public would be affected by a change in policy, the Court concludes that consistency, during the pendency of a court case, benefits the public interest."

The school boards that took part in the legal battle include: Alexandria City, Arlington County, City of Richmond, Fairfax County, Falls Church City, Hampton City and Prince William County. Combined, those school districts represent more than 350,000 students and nearly 50,000 teachers and staff.

Child wears mask in New York City school

A child wears a face mask on the first day of New York City schools, amid the coronavirus pandemic in Brooklyn, New York, on September 13, 2021. (REUTERS/Brendan McDermid/File Photo)

Following the judge's decision, Macaulay Porter, a spokesperson for Youngkin, released a statement and vowed to appeal the ruling, saying the ability for parents to decide what is best for their children in school is something Youngkin will continue to fight for.

"The governor will never stop fighting for parents’ ability to choose what is best for their children," Porter said. "The governor often said that this is not a pro-mask or anti-mask debate. It’s about parents knowing what’s best for their child’s health, and opting-out should there be a mask mandate."

"More voices, including from the scientific and medical community, call into question the efficacy behind a universal mask mandate for children," Porter added. "This is about what’s best for their kid’s health and who can best make that decision. We are going to appeal, this is just the first step in the judicial process."

Virginia Gov. Glenn Youngkin, center, signs executive orders in the Governors conference room at the Capitol on Saturday Jan. 15, 2022, in Richmond, Va.

Virginia Gov. Glenn Youngkin, center, signs executive orders in the Governors conference room at the Capitol on Saturday Jan. 15, 2022, in Richmond, Va. (AP Photo/Steve Helber, File)

CLICK HERE TO GET THE FOX NEWS APP

The optional mask order, which Youngkin signed on his first day in office and which took effect on Jan. 24, does not prevent students from wearing masks in schools, as some progressives have argued at times.

Last month, Youngkin made it clear himself that he would fight back to ensure parental "rights are protected."

"We will use every resource within the governor's authority to explore what we can do and what we will do in order to make sure parents' rights are protected," the governor told reporters in January.

Fox News' Brian Flood and David Rutz contributed to this article.