(CNN) New York City has declared the measles outbreak affecting the Orthodox Jewish community in Williamsburg to be a public health emergency, Mayor Bill de Blasio said Tuesday.

Unvaccinated people living in select ZIP codes will be required to receive the measles, mumps and rubella vaccine, known as MMR, to curtail the outbreak and protect others, he said.

Under the mandatory vaccinations, members of the city's Department of Health and Mental Hygiene will check the vaccination records of any individual who may have been in contact with infected patients. Those who have not received the MMR vaccine or do not have evidence of immunity may be given a violation and could be fined $1,000.

"Every hour, every day matters here. If people would just go and get vaccinated, there's no cause for a fine," de Blasio said. "It's not our goal to issue violations. We want to simply solve the problem."

New Yorkers should call 311 to access a list of facilities that can provide the measles vaccine at low or no cost, de Blasio said.

Outbreak began in October

The public health emergency comes in response to 285 cases of measles reported in Brooklyn and Queens since the beginning of the outbreak in October. The same outbreak is responsible for 15 cases of measles in Orange County, New York, and 168 cases in Rockland County, New York. The outbreak began when, according to health officials, an unvaccinated child became infected with the illness while visiting Israel.

"Since then, there have been additional people from Brooklyn and Queens who were unvaccinated and acquired measles while in Israel. People who did not travel were also infected in Brooklyn and Rockland County," the New York City Department of Health and Mental Hygiene says.

Of the 285 New York City cases, the range of ages has been 1 month to 66 years, with 246 children affected, Health Commissioner Dr. Oxiris Barbot said Tuesday. Five of 21 hospitalized cases have been admitted to the intensive care unit, she added.

Deputy Mayor for Health and Human Services Dr. Herminia Palacio warned of "measles parties," where parents bring together unvaccinated children with a sick child to intentionally spread the disease.

"Avoid this practice," Palacio said. Measles parties are dangerous because the disease can be fatal. "This vaccine is safe," she added, noting that it not only protects your child, it protects other people. "A variety of misunderstandings and frank untruths that are being propagated through a variety of channels."

Despite problems, there are hopeful signs, Barbot noted. Since September, 8,000 people have been vaccinated.

Measles outbreaks nationwide

Measles is a highly contagious, vaccine-preventable respiratory illness characterized by a rash of flat red spots. Symptoms may include fever, cough, runny nose and watery eyes.

Measles can also lead to death when complications become too severe, according to the US Centers for Disease Control and Prevention. About 1 child out of every 1,000 who get measles will develop encephalitis -- swelling of the brain -- that can lead to convulsions, deafness or intellectual disability. As many as 1 out of every 20 children with measles will get pneumonia, the agency reports.

"You can be infectious four days before you actually develop the rash," Barbot said. Measles is an airborne disease, so a sneeze can spread it, and infectious germs can last two hours after a person has left the room.

"There's nothing in Talmudic law that prohibits vaccination," Barbot said.

Nationwide, measles outbreaks have been reported in 19 states: Arizona, California, Colorado, Connecticut, Florida, Georgia, Illinois, Indiana, Kentucky, Massachusetts, Michigan, Missouri, Nevada, New Hampshire, New Jersey, New York, Oregon, Texas and Washington.

At least 465 cases of measles have been reported across the United States since January 1, according to numbers shared by the CDC on Monday.

The total number of measles cases nationwide this year "is the second-greatest number of cases reported in the U.S. since measles was eliminated in 2000," the CDC says. That threshold was reached last week when the national total for the year surpassed last year's total of 372. The largest outbreak was in 2014, when there were 667 cases reported nationwide due to several large outbreaks.

Along with the outbreak affecting Brooklyn's Orthodox Jewish community, Rockland County in upstate New York is also experiencing a high number of measles cases within its own Orthodox Jewish community.

As of Friday, the county reported 153 confirmed cases, though state health officials noted that additional cases have not been reported. Last month, in an effort to contain this outbreak, Rockland County banned unvaccinated people under age 18 from public places. Late Friday, acting state Supreme Court Justice Rolf Thorsen issued a restraining order to block the county from enforcing the ban.

Rockland County Executive Ed Day said Tuesday that he plans to appeal the judge's decision.

He and members of the county's Department of Health spent the weekend working on potential strategies for thwarting the outbreak that "jumped from 151 cases to 168 in just 10 days," he said. "We are taking the steps we can take while waiting for the court to move forward."

Rockland County Commissioner of Health Dr. Patricia Schnabel Ruppert explained that the county is in the process of developing new criteria to identify specific unvaccinated people who have been exposed to the measles in order to issue orders that require them to remain at home for 21 days, the length of the illness' incubation period. If caught in violation of this rule, people will be fined, she said.

"The MMR vaccine works faster than the incubation of the disease," Ruppert said.

"This disease has affected mainly children in the county," she said. "Stay the heck home if you've been ill or exposed."

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.

New York City's mayor said a legal action like the one that blocked Rockland County's ban will not hinder its mandatory vaccination policy. The city's legal department has looked into the mandatory vaccination "extensively," de Blasio said. "We are absolutely certain we have the right to do this. If anyone is thinking of a legal challenge, we are absolutely comfortable that we will win that case."

He also emphasized the danger measles poses to children, pregnant women and immune-compromised people, who are at highest risk of an infection.

"We saw only two cases in New York City in 2017, so we have a very serious situation on our hands," de Blasio said. "We cannot allow this dangerous disease to make a comeback in this city. We have to stop it now."