U.S. Defense Secretary Jim Mattis accused Russian President Vladimir Putin on Saturday of being a "slow learner" who again tried to meddle in U.S. elections in November, adding that he had no trust in the Russian leader.

The remarks by Mattis at a security forum in California came a day after President Donald Trump held informal talks with Putin on the sidelines of the Group of 20 industrialized nations meeting in Argentina. Trump had scrapped a more formal meeting with Putin, citing Russia's treatment of Ukraine, Reuters reported.

Read alsoTrudeau demands Putin release imprisoned Ukrainian sailors at G20 – media

Asked if U.S.-Russian ties had become more strained since he took over the Pentagon last year after Trump became president, Mattis said, "There's no doubt the relationship has worsened."

"(Putin) tried again to muck around in our elections this last month. And we are seeing a continued effort along those lines," Mattis said, adding that the United States would take whatever steps were necessary to defend American democracy.

Russian forces opened fire on Ukrainian naval vessels last weekend and seized them and their crew near Crimea, which Russia annexed from Ukraine in 2014. Mattis said those actions underscored why the international community was increasingly distrustful of Moscow.

"Mr. Putin is clearly a slow learner. He is not recognizing that what he is doing is actually creating an animosity against his people," Mattis said.

"What we are seeing Putin do with his ripping up of international agreements... we're dealing with someone that we simply cannot trust," the Pentagon chief added.