WASHINGTON — Over the past month, President Vladimir V. Putin of Russia has received two starkly different messages about hacking into American computer networks from the current and future presidents of the United States: Don’t you dare, and don’t worry, we’re not even sure it was you.

The White House confirmed in a statement on Wednesday that eight days before the presidential election, the United States “contacted the Russian government directly regarding malicious cyberactivity” that was “targeting U.S. state election-related systems.” It sent the message over a rarely used system: a hotline connecting the Nuclear Risk Reduction Centers in both countries, which they had agreed three years ago could also be employed to deal with major cyberincidents.

The pre-election warning — only the latest after verbal cautions by President Obama, his defense secretary and the director of national intelligence — was reported by The Washington Post.

The warnings to Russia against further hacking into polling or registration systems, or any further effort to affect the outcome of the election, are being hailed by the Obama administration as a success in deterrence. After all, they argue, a year and a half of Russian hacking activity seemed to slow, or halt, and there is no evidence that voting or counting of ballots was disrupted on Election Day.