(CNN) Unvaccinated people under age 18 are banned from public places in Rockland County, New York, as of midnight Wednesday, according to John Lyon, director of strategic communications for County Executive Ed Day.

Day announced the order Tuesday.

The declaration is an effort to contain an outbreak of measles that began in October; 153 cases have been confirmed in the county.

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

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

"We're not punishing the people who are doing the right thing already and following the rules. We just want to encourage everyone to do the right thing so we can stop this outbreak," Rockland County's Lyon said. The step is "extremely unusual. [We] don't believe it's been done anywhere in the country before."

"State law gives health departments authority to broadly implement control measures in response to outbreaks," Jason McDonald, a spokesman for the US Centers for Disease Control and Prevention, wrote in an email, noting that the CDC provides technical assistance to state and local health departments.

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.

This is the 26th week -- the sixth month -- of the outbreak in Rockland County, according to Lyon, who said it has been the longest outbreak in the United States since before measles was declared eliminated in 2000.

Day said the outbreak will not go on indefinitely. "This is a public health crisis, and it is time to sound the alarm, to ensure that everyone takes proper action to protect themselves and their neighbors; for the health and safety of all of us in Rockland," he said in a news release.

Public places include synagogues, churches, schools, restaurants, stores and public buses. "Public places are defined as: a place where more than 10 persons are intended to congregate," the news release says.

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 because "we did not want to prevent anyone from going to work," but unvaccinated adults are also encouraged to get vaccinated.

It will be enforced the same way any law is enforced, according to Lyon: During the investigation into when and where an infected individual was exposed, those who are identified as unvaccinated and people in public places will be referred to the district attorney's office.

"The goal is not to prosecute people. We don't want to fine people. We want to encourage people to get vaccinated," he said.

In cases that are referred to the district attorney, Day said the penalty is six months in jail and/or a $500 fine.

"Just to be clear, this is not something we're looking to do. The emergency declaration, by law, comes with that assigned. It's the lowest crime there is." He admitted that police officers will not be walking around asking parents for proof of vaccination for their children. He also said this is just to draw attention to make people understand the seriousness of the situation.

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

"As this outbreak has continued, our inspectors have begun to meet resistance from those they are trying to protect. They have been hung up on or told not to call again. They've been told 'we're not discussing this; do not come back' when visiting the homes of infected individuals as part of their investigations. This type of response is unacceptable and irresponsible. It endangers the health and well-being of others and displays a shocking lack of responsibility and concern for others in our community," Day said.

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, he said, noting that there have been complications among patients, including a premature labor and a handful of hospitalizations.

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

"Every new confirmed case is a roll of the dice that we'll see more complications. There's a lot that can go wrong with any case."

Statewide, there have been at least 378 cases of measles reported since October.

The CDC has reported 314 cases of measles nationwide this year as of Monday. That number reflects cases reported by state health departments as of Thursday but not cases reported since then.