Russian President Vladimir Putin. Thomson Reuters Russian President Vladimir Putin told a group of foreign policy experts in southern Russia on Thursday that Donald Trump's "extravagant behavior" is just his way of getting his message across to voters.

"He has chosen a method to get through to voters' hearts," Putin said at the annual meeting of the the Valdai Discussion Club in Sochi.

Trump "behaves extravagantly of course, we see this, but I think there's a reason for this. He represents part of US society that's tired of having the elite in power for decades," Putin said.

Putin said the mainstream US media's claim he supports Trump over Hillary Clinton, the Democratic nominee, is "nonsense," but that Russia "welcomes statements that US-Russian relations should be improved from anyone." The US intelligence community has accused the Russian government of hacking Democratic Party organizations, a charge Russia has denied.

Putin and Clinton have a history of mutual distrust, stemming from Clinton's claim in 2011 that Russia's elections that year were fraudulent — which Putin said "set the tone for certain actors inside the country" to protest — and her support for a military intervention in Libya to oust Moammar Gadhafi, which he said was done "without court or investigation."

Trump's stances on the US's positions in the international community, meanwhile, have tended to align with Putin's.

Donald Trump. Joe Raedle/Getty Images

From threats about pulling out of NATO to altering the Republican Party's policy on Ukraine — which has long called for arming Ukrainian soldiers against pro-Russia rebels — Trump is "the gift that keeps on giving" for Putin, Russian journalist Anna Nemtsova wrote in Politico in July.

Trump throughout his campaign has praised Putin for being a "leader, unlike what we have in this country," and has said he thinks he would "get along well" with Putin if he were elected.

"I don't think he has any respect for Clinton," Trump said in July. "I think he respects me. I think it would be great to get along with him."

Putin has returned the compliments, telling reporters in December that Trump is "a very lively man, talented without doubt" and the "absolute leader in the presidential race."

Trump's former campaign manager, Paul Manafort, resigned this summer amid controversy over his previous position advising the Party of Regions, the political party led by the Russian-backed Ukrainian President Viktor Yanukovych before he was driven out of power in 2014 and exiled to southern Russia.

'Is America a banana republic or what?'

Putin, who spent the better part of his speech on Thursday criticizing Obama administration policies, said that reports of Russian interference in the US election were "hysteria."

"Hysteria has been whipped up in the United States about the influence of Russia over the US presidential election," Putin said. "It's much simpler to distract people with so-called Russian hackers, spies, and agents of influence. Does anyone really think that Russia could influence the American people's choice in any way? Is America a banana republic or what? America is a great power."

Reports emerged in June that the Democratic National Committee had been infiltrated by Russian-aligned hackers. Hacked emails from Democratic Party officials that revealed their apparent coolness toward Bernie Sanders' presidential campaign began appearing on WikiLeaks and the website DCLeaks.com as Trump's campaign gained steam.

The leaks led to the resignation of the Democratic National Committee Chairwoman Debbie Wasserman Schultz.

The US earlier this month publicly accused the Russian government of orchestrating those cyberattacks, stating that "only Russia's senior-most officials could have authorized these activities."

Putin on Thursday again denied any state involvement in the cyberattacks.

"Cyberattacks against sovereign nations are unacceptable," he said. "A nation must respect other nations and adhere to common rules for the world. The gap between elites and their peoples are a major factor in today's problems, but not the only one, of course."