Officials in one New York county are trying anything they can to stop one of the state’s largest measles outbreaks in decades.

Rockland County officials declared a state of emergency Tuesday, that will be in effect for the next 30 days that prohibits unvaccinated minors from being at indoor locations like churches, schools and shopping centers. They are allowed in outdoor places like a playground, The Washington Post reported.

If a minor becomes vaccinated by the measles, mumps and rubella vaccine, then they will be allowed in the protected spaces, according to the Post.

>> Read more trending news

"We must not allow this outbreak to continue. We will not sit idly by while children in our community are at risk," County Executive Ed Day said during a news conference, according to The New York Times.

Day added that they will not search for children who are not vaccinated, but if parents or guardians are found violating the order, the district attorney will be contacted. It could be considered a misdemeanor and could be punished by a $500 fine or six months in jail, the Post reported.

Children who cannot receive the vaccination because of a medical reason are exempt from the state of emergency declaration.

Rockland County has had more than 150 confirmed cases of measles, CNN reported.

A majority, more than 82 percent of those who have come down with measles, have never had a dose of the MMR vaccine, according to the Centers for Disease Control and Prevention.

Measles, a highly contagious virus, can cause high fever, pneumonia, brain swelling and even death, according to the CDC.

The CDC recommends two doses of the MMR vaccine. Normally the first is given at 12 to 15 months of age, the second is from 4 to 6 years old, in time for school.

Measles was said to have been eliminated in the U.S. in 2000. In 2019, there have been 314 confirmed cases of the illness, according to the Post.