A county just north of New York City declared a state of emergency Tuesday and banned children not vaccinated against measles from public spaces, officials said.

Rockland County Executive Ed Day cited a state law, which gives local officials sweeping powers “in the event of reasonable apprehension of immediate danger” to the public.

The declaration was the most aggressive step taken by New York health officials since the outbreak began in Oct. 2018.

“Effective at the stroke of midnight, Wednesday, March 27, anyone who is under 18 years of age and unvaccinated against the measles will be barred from public places until this declaration expires in 30 days or until they receive the MMR vaccination,” Day said at a press conference.

The public spaces include schools, stores, places of worship and public transit.

Local police will not be asking for documentation of vaccinations, but they will enforce it retroactively if a parent is found to have allowed their unvaccinated kids into the public spaces, according to the county.

“If you are found to be in violation, your case will be referred to the district attorney’s office. Parents will be held accountable. The focus of this measure is on the parents. We want to urge parents to do the right thing,” Day said.

“We want parents to recognize that this is against the law. This is a governmental decision made to support the Department of Health. It is listed as a B misdemeanor, which is up to 6 months in jail or a $400 fine. It is the lowest misdemeanor, the lowest crime there is,” Day added.

Rockland County health officials emphasized that those who are in violation of the new vaccination law will not be forced to be vaccinated, but that the parents will be made accountable.

The New York City suburb has been one of the hardest hit by measles due to low vaccination rates in ultra-Orthodox communities. Day noted that health officials are working with rabbis to increase vaccination rates to restore herd immunity.

The seat of Rockland County is in the hamlet of New City, about 35 miles north of midtown Manhattan. The county, which has been one of the hardest hit by measles, is the first to use “the authority of the law” to help enforce vaccinations in public schools, according to its health officials.

As of Tuesday, 153 cases have been confirmed in Rockland County. More than 82 percent of these cases had not received a single dose of the MMR vaccine — 45.7 percent of those were between the ages of 4 and 18.

If you are going to People magazine and getting your medical advice from people like Jenny McCarthy, you need to reexamine yourself.

“What they’ve done is re-created the old concept of quarantine,” said Dr. William Schaffner, an infectious disease expert at Vanderbilt University and a spokesman for the Infectious Diseases Society of America. “It’s a device to assist in ending the outbreak, it is not a punishment. It is designed to interrupt transmission and protect the vulnerable.”

Schaffner added that society has a long history of supporting our freedoms while also curtailing them to some extent. “We’ve all agreed to go on green and stop on the red. That’s been legislated, that’s not a matter of choice, but we have all experienced someone who has gone on the red,” he said.

“That endangers yourself and other people in the society around you. The government has a responsibility to curtail hazards that are around us. So is the same with communicable diseases.”

Day emphasized that he wanted this announcement to be seen as an “attention grabber” and that he did not want misinformation to overshadow “the greater good of our community.”

“If you are going to People magazine and getting your medical advice from people like Jenny McCarthy, you need to reexamine yourself, that’s a fact of life,” he said.

Public health officials applauded Rockland County’s response to this growing public health crisis.

“In general, voluntary requests can yield high response rates. However, this is a true emergency and has the potential to be even more problematic,” said Cheryl Healton, dean and professor at the College of Global Public Health at New York University.

“I think that people in the U.S. will rue the day they turned their back on vaccines that people in other countries stand in line to receive,” Healton told NBC News.