[What you need to know to start the day: Get New York Today in your inbox.]

Public officials and health experts had given several warnings: Do not allow a student in school if they had not been vaccinated against measles.

Still, during New York City’s largest measles outbreak in a decade, a school in Brooklyn ignored that advice, resulting in one student infecting at least 21 other people with the virus.

The outbreak, at Yeshiva Kehilath Yakov in Williamsburg, is reigniting concerns that too many people in New York’s ultra-Orthodox Jewish communities are unvaccinated, as well as worries that measles would continue to spread after travelers arrived last fall from parts of Israel and Europe, where the virus was spreading.

City officials said they have struggled to increase vaccination rates in certain communities because of popularity of the widely debunked anti-vaccination movement, with parents declining vaccines for their children in fear that they increase the risk of autism.

In December, the city’s Health Department issued an emergency health measure, ordering that schools in selected ZIP codes prohibit unvaccinated students from attending classes. The outbreak at Yeshiva Kehilath Yakov occurred in late January.

The Health Department said last week that the yeshiva student — who, along with the other victims, has not been identified — was not vaccinated. The child did not show symptoms while in class.

[One More Time, With Big Data: Measles Vaccine Doesn’t Cause Autism]

Measles is one of the most contagious infections and can live for up to two hours in the airspace where an infected person breathed, coughed or sneezed.

“It’s so important for schools to exclude children who have not been vaccinated during outbreaks,” Dr. Oxiris Barbot, the commissioner of the Health Department.

The outbreak in New York began in the fall. Within months, the state had recorded nearly 200 cases. Dr. Barbot said that in New York City 133 cases have been recorded for people ages 6 months to 59 years, and that several people, including children, have been hospitalized. There have been no known fatalities.

Yeshiva Kehilath Yakov did not respond to a request for comment, but the Health Department said that it has followed up with the school and that it is now abiding by the emergency measure.

The department also said that since fall, about 10,000 people across the city had been vaccinated, noting that more than 7,000 live in the most-affected areas, Williamsburg and Borough Park.

But Dr. Barbot said there were still hurdles in ultra-Orthodox communities. “What we have to work against is the proliferation of inaccurate information on the internet,” she said. “So, lots of our time is spent on providing education to dispel any myths and make it easy for people to get vaccinated.”

The vaccine, which is usually given in two doses between ages 1 and 5, is highly effective; the virus was declared eliminated as a major public health threat nearly 20 years ago.

“It says in the Torah ‘V’nishmartem Meod L’nafshoseichem,’ that a person must guard their health,” Rabbi David Niederman, the president of the United Jewish Organizations of Williamsburg and North Brooklyn, said in a statement. “It is abundantly clear on the necessity for parents to ensure that their children are vaccinated.”

City officials are also continuing to warn residents about risks to the larger community.

“Parents who oppose vaccinations for measles and all other illnesses not only put their own children at risk, but endanger other children and families as well,” Councilman Mark Levine, the chairman of the City Council’s Committee on Health, said in a statement. “I strongly urge all parents across the city to ensure their children are up-to-date on all American Medical Association recommended vaccinations.”