Russians penetrated voter registration rolls in several states before the 2016 presidential election, according to a U.S. official charged with protecting American elections from hackers.

"We saw a targeting of 21 states and an exceptionally small number of them were actually successfully penetrated,” Jeanette Manfra, the Department of Homeland Security’s head of cybersecurity, told NBC News in a report published on Wednesday.

Manfra said her assessment came from a "snapshot in time with the visibility that the department had at that time." There was no evidence that any registration rolls were compromised.

Related: Russian bots targeted Clinton and Mueller leading up to collusion indictments

Jeh Johnson, who served as the department’s secretary during the hacking, said they were “able to determine that the scanning and probing of voter registration databases was coming from the Russian government."

Johnson added that 2016 "was a wake-up call and now it's incumbent upon states and the Feds to do something about it before our democracy is attacked again."

The attempted intrusions were aimed at targeted online systems including registration databases, not the voting itself or tabulation machines used on Election Day. The penetration attempts were not tied to the Internet.

Before leaving his post in January 2017, Johnson designated the electoral systems a part of the U.S.’s federally protected “critical infrastructure,” making it the department’s official duty to safeguard them. But Johnson said he is concerned that many states have done little or nothing at all to boost their cybersecurity.

Manfra disagreed, saying, the states “have all taken it seriously.”

Of the 21 states NBC News reached out to, five—including California and Texas—reported they had not been attacked.

Russian interference in the presidential election took shape in other forms and continues to be a matter of concern among U.S. officials. Twitter users in swing states received more fake news than real news in the days leading up to the election, a study revealed late last year. Last year, Twitter, Facebook and Google testified before U.S. Congress on how the Russian government manipulated public opinion leading up to and during the election. 

Special counsel Robert Mueller has stepped up his investigation into possible collusion between President Donald Trump’s campaign and Russians in the election.