A measles outbreak in Brooklyn, primarily among Orthodox Jewish children, prompted New York City to declare a public health emergency, requiring unvaccinated people in the affected areas to get the vaccine or face fines.

The city's largest outbreak since 1991 of the once virtually eradicated disease has mainly been confined to the Orthodox Jewish community in the borough's Williamsburg neighbourhood, with 285 cases confirmed since October, Mayor Bill de Blasio said at a news conference.

That is up sharply from only two reported cases in all of 2017.

"This is the epicentre of a measles outbreak that is very, very troubling and must be dealt with immediately," Mr de Blasio said.

He was joined by city health officials who decried what they called "misinformation" spread by opponents of vaccines.

The measles virus is highly contagious and can lead to serious complications and death.

While there have been no confirmed deaths so far, 21 people have been hospitalised, with five admitted to intensive care, officials said.

All but 39 of the confirmed cases are in children.

The outbreak is part of a broader resurgence in the United States, with 465 cases reported in 19 states so far this year, according to the US Centers for Disease Control and Prevention.

The United States declared measles eliminated from the country in 2000 thanks to widespread vaccination, meaning it is no longer constantly present.

But vaccination rates have declined in recent years, according to infectious disease experts.

The Brooklyn outbreak has been traced to an unvaccinated child who became infected on a visit to Israel, which is also grappling with an outbreak, according to New York City's Department of Health.

Officials from the Department of Health will check vaccination records of anyone who has been in contact with infected patients in certain parts of Brooklyn, officials said.

They will impose fines of up to $1,000 on those who have not received the measles-mumps-rubella vaccine and cannot give other evidence of immunity, such as having previously had the measles.

It is the first time New York City has ordered mandatory vaccinations in recent history, according to health officials.

Community leaders and doctors welcomed the move.

"We will make sure that everybody who is allowed will be vaccinated," Rabbi David Niederman, the president of the United Jewish Organizations of Williamsburg, said.

The schools are cooperating, everyone's cooperating."

He said he had seen misinformation circulate around the tightly knit community, but that most families trusted the Health Department.

"You get phony, phony articles and studies, so yes, some people will fall for that," he said.

"They will do anything and everything to improve the health of their children."

Doctors in affected communities said an anonymously produced anti-vaccine booklet targeting Orthodox Jews that contained false information had appeared over the last couple of years, which had sown doubts and hesitancy among some parents.

"In general, the Orthodox community does immunise," said Dr Joseph Kaplovitz, who works at the NYU Langone Stepping Stones Pediatrics clinic in Brooklyn's Borough Park.

Dr Jeffrey Dick of Kindercare Pediatrics in Williamsburg said his practice had seen at least a dozen measles cases in recent months, but also an uptick in families seeking vaccinations as worry about the outbreak spread.

The mandatory vaccination order follows one from the Health Department last week requiring yeshivas and day-care programmes serving Williamsburg's Orthodox Jewish community to exclude unvaccinated children or face fines or closure.

Another outbreak has hit Orthodox Jewish families in New York's Rockland County. Officials there banned children not vaccinated against measles from public spaces last month.

That order was overturned by a state judge on Friday, local media reported.

The order is being appealed by Rockland officials.

Federal officials are also tracking outbreaks in New Jersey, California, Michigan and Washington state.

A growing and vocal fringe of parents oppose vaccines believing, contrary to scientific evidence, that ingredients in the vaccines can cause autism or other disorders.

City officials also expressed alarm at reports of parents holding "measles parties," where they intentionally expose their unvaccinated children to an infected child in the mistaken belief that doing so is a safe way to create immunity.

"I understand that parents may be afraid of getting their children vaccinated," said Oxiris Barbot, the city's health commissioner.

"I know that getting vaccinated is far safer than getting measles".