Election officials in 21 states have been notified by the Department of Homeland Security that hackers targeted voter registration systems ahead of last year’s presidential election.

In most cases, the systems were not breached. A small number of networks were compromised, but those affected were not involved in the actual tallying of votes. In most of the states, the targeting involved preparatory activity, such as scanning computer systems.

Alabama, Arizona, California, Colorado, Connecticut, Illinois, Iowa, Maryland, Minnesota, Ohio, Oklahoma, Pennsylvania, Virginia, Washington and Wisconsin had confirmed they had been targeted as of Friday evening.

In most cases, the states had not known until notified by DHS Friday, though the government had told the Associated Press last year that more than 20 states were targeted by hackers believed to be Russian agents.

The government did not say Friday who was behind the hacking attempts or provide details about what had been sought. But election officials in three states said Friday the attempts could be linked to Russia.

The Wisconsin Election Commission, for example, said the state’s systems were targeted by “Russian government cyber actors.”

Only Illinois reported that hackers had succeeded in breaching its voter systems.

Colorado said the hacking wasn’t quite a breach.

“It’s really reconnaissance by a bad guy to try and figure out how we would break into your computer,” said Trevor Timmons, a spokesman for the Colorado secretary of state’s office. “It’s not an attack. I wouldn’t call it a probe. It’s not a breach, it’s not a penetration.”

The disclosure to the states comes as a special counsel probes whether there was any coordination during the 2016 presidential campaign between Russia and associates of Donald Trump.

“It’s unacceptable that it took almost a year after the election to notify states that their elections systems were targeted,” said Sen. Mark Warner, D-Va., the vice-chairman of the Senate Intelligence Committee, “but I’m relieved that DHS … is finally informing the top elections officials in all 21 affected states that Russian hackers tried to breach their systems in the run up to the 2016 election.

“We have to do better in the future,” Warner added. “Our elections are the bedrock of our democracy, and DHS needs to notify states and localities in real-time when their systems are targeted.”

Trump, a Republican who defeated Democrat Hillary Clinton in the presidential election, has called the Russia story a hoax. He says Russian President Vladimir Putin “vehemently denied” the conclusions of American intelligence agencies.

Fox News’ Bill Mears and The Associated Press contributed to this report.