A vial of the measles, mumps, and rubella virus (MMR) vaccine is pictured at the International Community Health Services clinic in Seattle, Washington, U.S., March 20, 2019.

President Donald Trump on Friday urged people to get vaccinated for measles, saying it's "so important" amid the worst year for the disease in the U.S. since it was declared eliminated from the country in 2000.

"They have to get the shots. The vaccinations are so important. This is really going around now. They have to get their shots," Trump told reporters in response to a question about measles before departing for Indiana to give a speech at the National Rifle Association's annual convention.

Trump had previously been silent on the issue, even as the disease reached 22 states. The Centers for Disease Control and Prevention has confirmed 695 cases this year, surpassing the post-2000 record in just the first four months of the year.

For more on investing in health-care innovation, click here to join CNBC at our Healthy Returns Summit in New York City on May 21.

Encouraging people to get vaccinated marks a reversal for Trump, who has pushed false claims about vaccines in the past. He has questioned their safety and stoked fear that vaccinating babies might contribute to rising autism rates. Scientists have repeatedly debunked a now-retracted study from the 1990s that falsely claimed vaccines cause autism.

Tweet

The current U.S. outbreaks arose after unvaccinated people traveled overseas, where large outbreaks are occurring, and brought them back to communities where some people choose not to vaccinate, the CDC said. In New York City and New York's Rockland County, the disease is spreading among the close-knit ultra-Orthodox Jewish community, which anti-vaxxers have targeted. An outbreak is declared when more than three cases are confirmed.

Measles is highly contagious, infecting 90% of unvaccinated people who are exposed to the disease, the CDC said. The measles, mumps and rubella vaccine offers the best protection. Receiving both recommended doses is 97% effective in preventing the measles, according to the CDC.

Correction: This story was revised to clarify that the 695 cases this year is the most for a year since 2000. In addition, a previous version incorrectly stated the number of states with active outbreaks. Measles cases have been reported in 22 states this year. Outbreaks are currently ongoing in five states.