U.S. diplomats and embassy staff risk punishment if they "meddl[e]" in upcoming Russian elections, Foreign Minister Sergey Lavrov warned.

"I am unaware of the U.S. Embassy's plans, but there were many incidents when American diplomats were involved in illegal activities," Lavrov said Friday at a youth forum. "Our relevant services should take appropriate measures."

Russian President Vladimir Putin and his team have accused the U.S. for years of interfering in their elections, most notably blaming then-Secretary of State Hillary Clinton of stoking protests against election fraud in 2011. Lavrov complained in particular the State Department had tried to "conduct opinion polls" in the run-up to past Russian elections.

"They probably do not consider this to be meddling, because they are allowed to do anything, and that's in their blood," Lavrov said, per TASS, a state-run media outlet. "However, if this happens, we have our own laws, the Vienna Convention on Diplomatic Relations, which says explicitly and specifically what diplomats can do and what they cannot do. ... We will be guided by it and by our laws."

Putin was motivated to interfere in the 2016 election in part to retaliate against Clinton's criticism of Russia's campaigns, according to U.S. intelligence officials.

"Putin most likely wanted to discredit Secretary Clinton because he has publicly blamed her since 2011 for inciting mass protests against his regime in late 2011 and early 2012, and because he holds a grudge for comments he almost certainly saw as disparaging him," the Office of the Director of National Intelligence reported in January.

Lavrov said accusations of Russian interference remain "unsubstantiated," but he suggested that the development of the controversy will shape Russia's attitude toward American diplomats during their elections.

"I hope that ... the acuteness of the issue for the American establishment will make them think twice," he said.