President Donald Trump on Friday urged parents to get their children vaccinated after the Centers for Disease Control and Prevention announced this week that measles cases had reached a record high since the disease was declared eliminated in 2000.

"They have to get the shot. The vaccinations are so important," Trump said outside the White House on his way to Indianapolis to address the NRA. "This is really going around now, they have to get their shot."

New cases of measles reported in New York, New Jersey and California bring the total number of infections in the U.S. to at least 695 so far in 2019 according to new numbers released by CDC.

Nearly 300 students and employees at two Los Angeles universities were under quarantine Thursday and Friday after possible exposure to measles.

Trump's comments on Friday differed from his past remarks on vaccinations.

Download the NBC News app for breaking news and politics

At a 2015 Republican presidential candidate debate hosted by CNN, Trump said that he wanted to change the vaccine schedule for children, erroneously linking autism to vaccines.

"Autism has become an epidemic…I am totally in favor of vaccines. But I want smaller doses over a longer period of time," he said.

In a March 2014 tweet, Trump questioned why a child "gets pumped with massive shot of many vaccines."

"Healthy young child goes to doctor, gets pumped with massive shot of many vaccines, doesn't feel good and changes — AUTISM. Many such cases!" he tweeted.

There is no link between vaccines and autism, according to multiple studies, health care experts and the CDC. Since 2003, the CDC has also conducted or funded nine studies that show that vaccine ingredients, such as the mercury-based preservative thimerosal, do not cause autism.

The CDC has urged health care providers to assure patients that the vaccine is safe and effective, reiterating in a Thursday statement that "vaccination is the best way to protect against measles."

The reported measles cases were scattered across 22 states, an outbreak that CDC Director Robert Redfield called "deeply troubling” in a tweet.

"I encourage all Americans to adhere to CDC vaccine guidelines to protect themselves, their families, and their communities from #measles and other vaccine preventable diseases. We must work together as a Nation to eliminate this disease once and for all," he said Thursday.

I encourage all Americans to adhere to CDC vaccine guidelines to protect themselves, their families, and their communities from #measles and other vaccine preventable diseases. We must work together as a Nation to eliminate this disease once and for all. https://t.co/EljIiiBp5T — Dr. Robert R. Redfield (@CDCDirector) April 25, 2019

On Wednesday, New York City and suburban Rockland County confirmed an additional 37 measles cases, and California reported seven new cases. The second-highest number for measles cases in the U.S. was 667 in 2014, according to the CDC.

In New York City and Rockland County, there have been 590 cases since the measles outbreak began in October 2018. Los Angeles reported its first five cases on Monday.