ROCKLAND COUNTY, New York (WABC) -- A judge has ruled on behalf of several dozen parents who challenged Rockland County's emergency order banning children from public places unless they've been vaccinated against measles.A state Supreme Court judge made the ruling Friday on the legality of Rockland County Executive Ed Day's order, which is part of efforts to stop a measles outbreak that has infected more than 160 people since October.The 30-day order enacted on March 26 banned unvaccinated people under 18 years old from gathering places including schools, stores, churches and public transportation.The lawsuit was filed by civil rights lawyer Michael Sussman on behalf of parents of unvaccinated students at Green Meadow Waldorf School in Chestnut Ridge. Sussman called Day's action "arbitrary and capricious."The county attorney argued it was necessary to stop the contagious virus.The judge granted a temporary injunction, which for the time being, will end the state of emergency. This means unvaccinated children will once again be allowed to go to school and out in public.The judge said such emergency orders cannot exceed five days. He also noted that 166 measles cases in a population of 330,000 people over six months doesn't constitute an "epidemic" meriting an emergency declaration.Day released the following statement after the ruling:(The Associated Press contributed to this report.)----------