In 2013, 90 percent of Samoan infants received the measles-mumps-rubella vaccine by their first birthday. But by last year, the vaccination rate had dropped to 30 percent. The government said it had been complacent in routine immunizations. When two infants died after nurses inadvertently mixed the vaccine with muscle relaxant instead of sterile water, the country temporarily suspended the vaccination program.

That action, coupled with misinformation about the safety of the vaccine, left children under 5 particularly susceptible to the virus, according to the World Health Organization. When the virus arrived in Samoa from a person who had traveled from New Zealand, which is struggling with its own outbreak, the unvaccinated population was hit particularly hard.

Under the state of emergency, schools were closed, children were banned from public gatherings and vaccinations were made compulsory. Early this month, the government shut down to focus on a nationwide vaccination campaign. Dozens of countries and international organizations sent health workers and supplies to help hospitals straining to keep up with the caseload.

Health Ministry officials said that 95 percent of eligible people had received vaccinations, the threshold for “herd immunity,” which experts say is required to stop the spread of measles.