Over the last four days, Elon Musk has spoken out more than 50 times about President Nicolás Maduro of Venezuela — and the comments have been far from flattering.

“Shame on Dictator Maduro,” Mr. Musk wrote on X on Sunday, as results came in from Venezuela’s presidential election, which has been criticized as deeply flawed. The next morning, Mr. Musk posted that there had been “major election fraud by Maduro.” Since then, the world’s richest man has also compared Mr. Maduro to a donkey and suggested that he would be open to fighting the autocratic leader in hand-to-hand combat.

Mr. Musk, the 53-year-old chief executive of Tesla and SpaceX, has often criticized heads of state, including President Biden, on X. But the attacks against Mr. Maduro, who is one of the prominent symbols of the left in Latin America, stood out for their sudden volume and aggression.

They were part of a pattern by Mr. Musk of denouncing leftist ideals and socialism. In Venezuela, he has said, he sees a failed state with a collapsed economy that he blames on the corruption of leftist politicians. In some of his posts, Mr. Musk, who has endorsed former President Donald J. Trump in the U.S. presidential race, suggested that the United States could become like Venezuela if voters backed the Democratic Party in November.

In effect, Mr. Musk is using the firestorm over Venezuela’s election to reinforce his worldview that socialist and leftist forces are degrading global society, said Eugenia Mitchelstein, an associate professor at the University of San Andrés in Buenos Aires. Mr. Musk appears to have posted only once about Venezuelan politics before Sunday, she said, and is using the questions over the country’s election to “score very easy political points.”

“It’s the perfect case for him to be on the right side and to make allegiances to both the rule of law and right-wing politics,” Ms. Mitchelstein said.