All persons under 18 years old who haven’t been vaccinated against measles will be banned from public spaces in Rockland County, officials said.

The measure, part of a state of emergency declaration made in response to the countywide crisis, takes effect at midnight Wednesday, the county said in a statement.

As of last week, there were 151 confirmed cases of measles in the county, according to Rockland’s website.

Nearly half of those cases occurred in children between the ages of 4 and 18, the website stated.

Behind them are kids between 1 and 3 years old, making up 23.8 percent of cases.

The emergency declaration, given under the New York State Executive Law, will last 30 days.