The controversial ban went into effect late last month in an effort to contain an outbreak of measles that began in October. Nearly 170 cases have been confirmed in the county.

Judge Rolf Thorsen scheduled a hearing for April 19 and said the county is temporarily blocked from enforcing the ban.

“And petitioners’ children are hereby permitted to return to their respective schools forthwith and otherwise to assemble in public places,” he wrote.

The ruling came in response to lawsuits filed by the parents of local school children, with the parents calling the ban arbitrary and capricious and saying the county acted beyond its legal authority. The suits said the declaration caused “children to be denied attendance at nursery programs and schools and has effectively prohibited their movement and denied them the right to congregate and assemble in public places.”

The outbreak began when an unvaccinated resident became infected while visiting Israel and returned with the disease. It has mostly affected observant Jewish neighborhoods.

“The county is disappointed that the court did not see this measles outbreak, unprecedented in scope over the past 30 years, as a crisis sufficient to warrant the need for a declaration of a state of emergency,” County Attorney Thomas E. Humbach said.

He said the county was evaluating its next possible legal steps.

The judge wrote that the small percentage of cases in Rockland County didn’t meet the definition of an epidemic that the law permitting emergency declarations requires.

Rockland County Executive Ed Day said they didn’t want to wait for the number of cases to grow quickly.

“It is my view that waiting for a medical catastrophe is ill advised, particularly given the fact that we can see it coming,” he said. He urged residents to get a free vacination through the county health department.

New York City has reported nearly 260 cases as of Friday from the outbreak, also in Orthodox Jewish communities, according to the city department of health.

The ban was put in place March 27 “to encourage everyone to do the right thing so we can stop this outbreak,” John Lyon, a spokesman for Rockland County Executive Ed Day said at the time. He called the ban “extremely unusual.”

Measles is a highly contagious virus that is prevented with the measles, mumps and rubella vaccine. The CDC recommends that the two-dose vaccine be given first at 12 to 15 months of age and then between ages 4 and 6.

The outbreak in Rockland County is in its seventh month, according to Lyon, who said it has been the longest in the United States since before measles was declared eliminated in 2000.

Public places include synagogues, churches, schools, restaurants, stores and public buses, according to the county.

Children who are current with the vaccine schedule but not fully vaccinated against measles because they are not old enough are exempt from the order.

The order does not apply to people who are older than 18 so that residents can go to work but unvaccinated adults are also encouraged to get vaccinated, according to county officials.

Nearly 17,000 vaccinations have been administered in the county during the outbreak.

The outbreak has mainly been isolated in a couple of communities within Rockland County, which is just north of New York City, but the whole community is at risk, Day said, noting that there have been complications among patients, including a premature labor and a handful of hospitalizations.