New York City's Department of Health defended its mandatory measles vaccination order in a state court on Thursday after a group of anonymous Brooklyn parents sued, arguing that the order was unconstitutional.

The department issued the order last week, saying it was an unusual but necessary step to contain the worst outbreak of the highly contagious virus seen in the city since 1991. The outbreak has infected 329 people so far, most of them children from Orthodox Jewish communities in Brooklyn.

The order, which was extended this week, requires unvaccinated people living in certain affected Brooklyn neighborhoods to get the measles-mumps-rubella vaccine if they cannot otherwise demonstrate immunity to measles, or face a $1,000 fine.