President Biden called Vladimir V. Putin, the president of Russia, a “crazy son” during a late-night fundraiser in California, which the Kremlin dismissed as “Hollywood cowboy behavior.”

“We have a crazy son of a bitch like that guy Putin and others, and we always have to worry about nuclear conflict,” Biden told a crowd of donors in San Francisco on Wednesday night.

Biden’s comments drew the ire of Moscow, resulting in a direct tit-for-tat.

In a television interview, Putin said he thought he knew why Biden had lashed out. The Russian president had said last week that Russia was interested in Biden winning a second term, a statement seen by some as an indirect way of burdening Biden with the support of one of the United States’ greatest adversaries.

Putin said he believed Biden’s comment was a result of that endorsement.

“He can’t say: ‘Volodya, good boy, thank you, you helped me a lot.’ We understand what is happening with domestic politics in the United States,” Putin said, using a nickname for Vladimir.

Dmitri S. Peskov, the Kremlin spokesman, accused Biden of performing for his domestic audience.

“It is clear that Mr. Biden is demonstrating Hollywood cowboy-style behavior to serve domestic political interests,” Peskov said.

In California, Biden also sharply criticized former President Donald J. Trump for comparing his legal problems to the death of Aleksei A. Navalny, the Russian opposition leader.

“If I was here 10 or 15 years ago and said all this, everyone would think I should compromise,” Biden said. He added that Trump has been terrible for the Republican Party.

“I don’t agree with many Republicans, but they have been decent women and men. At least they had an American moral center. That seems to be lost on some of the things this guy has been saying,” Biden said of Trump.

“As if he was comparing himself to Nalvany and saying that because our country has become a communist country, he is being persecuted like Nalvany was. I mean, where the hell did this come from?

Trump has shown a notable affinity for Putin over the years. He recently stated that he would “encourage” Russia to “do whatever it wants” with countries he considered to be in default with NATO.

Biden has openly criticized Putin. Last week she blamed “Putin and his thugs” for Navalny’s death. She has also called Putin a “butcher” and, after the Russian invasion of Ukraine, said: “For God’s sake, this man cannot remain in power.”

By Sam