A rare outbreak of measles in New York City may have been spread by the failure of medical workers to recognize the disease quickly enough and to quarantine patients so they would not infect others, a city epidemiologist said this week.

Dr. Jay Varma, the health department’s deputy commissioner for disease control, said the department’s investigators were looking at whether some of the 20 confirmed cases, which are concentrated in northern Manhattan, might have resulted from exposure in medical facilities. Measles is one of the most contagious diseases and can be spread through airborne respiratory droplets even two hours after an infected person has left the room.

“We know a number of people were exposed and possibly got their infection either at a doctor’s office or at an emergency room where they went and it took more time than it should have for them to be put in an isolation area where they couldn’t possibly infect anyone else,” Dr. Varma said.

The first known case of the disease was detected in early February.

Dr. Varma declined to identify any medical facilities, saying that such exposure in a hospital was not unusual and that “we are not trying to shame any one institution.” But he said this route of exposure could make it harder to contain and to track the outbreak, because it was not concentrated in any one social or cultural circle, as contagious diseases often are.