New York City officials on Tuesday declared an end to the largest measles outbreak the city has seen in nearly 30 years.

Officials said New York City spent more than $6 million to combat the outbreak, which primarily affected Orthodox Jewish communities in Brooklyn. More than 500 staff were involved in response efforts, which included disseminating pro-vaccination booklets, distributing educational materials in multiple languages, and attending community events, among other efforts.

MEASLES CASES IN US HIGHEST SINCE 1992, CDC SAYS

In certain parts of Brooklyn, namely Williamsburg and Borough Park, officials administered more than 15,000 doses of the measles-mumps-rubella (MMR) vaccine since declaring an emergency order that required people living or working in affected areas to be vaccinated against the illness.

The end of the outbreak, which was declared a public health emergency in April, is announced when two incubation periods of measles — about 42 days — have passed since the last day a person with measles is considered infectious in an affected area, officials explained.

No new cases have been reported since mid-July, though the New York City Health Department “will continue monitoring and may add cases retrospectively as they are identified.”

“Ending the measles outbreak required extensive collaboration with community organizations and Jewish leaders. They helped encourage vaccinations and achieve record immunization levels in parts of Brooklyn,” Mayor Bill de Blasio said in a statement. “As we head back to school this week, we just remain vigilant. To keep our children and communities safe, I urge all New Yorkers to get vaccinated. It’s the best defense we have.”

Measles is a highly contagious virus that spreads through the air after an infected person coughs or sneezes. Others can contract measles when they breathe the contaminated air or touch a contaminated surface, and then touch their eyes, nose or mouth.

“Infected people can spread measles to others from four days before through four days after the rash appears,” the Centers for Disease Control and Prevention (CDC) says.

The MMR vaccine can protect both individuals and other people from contracting the virus.

Young children are typically most at risk of contracting measles. The CDC recommends children get two doses of the MMR vaccination, but the first dose is typically given to children when they are between 12 and 15 months old, with the second occurring between ages 4 and 6.

In New York City, most measles cases — 80 percent — were diagnosed in people under the age of 18, officials said. Overall, 654 people were diagnosed with the virus since the outbreak began in October of last year.

The news comes after federal health officials last week announced the U.S. is experiencing the highest number of measles cases since the early 1990s. The CDC in its weekly measles cases and outbreaks report said there are 1,215 confirmed measles cases in the U.S., representing an increase of 12 cases from the week before.

MEASLES EXPOSURE AT UNION STATION IN LOS ANGELES CONFIRMED: HEALTH OFFICIALS

Separately, a recent study by the University of Pittsburgh Graduate School of Public Health determined measles outbreaks in Texas, specifically, could be more commonplace as an increasing number of children in the state show up to school unvaccinated.

Texas, according to researchers, is the “largest state by population” that allows parents to not vaccinate their children for personal or religious reasons. And the number of exemptions has increased in recent years, growing from 2,300 in 2013 to 64,000 in 2016. The researchers found just a 5 percent decrease in the vaccination rate could increase the size of a potential measles outbreak by 4,000 percent in some communities in Texas.