Being a head of state is hard. You get criticized and scrutinized, all while having to do a pretty difficult job. But there is a right way to respond to criticism and a wrong way. And on Thursday the president of Ecuador, Rafael Correa, did it the wrong way: by tweeting "Heil Hitler."

Correa, who has 2.12 million followers, was engaging in an old-fashioned Twitter fight. While it looks crazy, and may indeed have been sent in a moment of frustration, this is likely not crazy at all but rather part of Correa's calculated and politically successful strategy of using dumb spats as a way to position himself as a man of the people bravely facing his many enemies.

The fight started when former Ecuadorian President Osvaldo Hurtado gave a speech in which he reportedly called Correa a "typical fascist." Panamanian politician Guillermo Cochez, a critic of Correa, tweeted that line from Hurtado's speech. Correa responded by tweeting "Heil Hitler," mocking the idea that he was a fascist.

In other words, it was a joke, if a pretty tasteless one. Tweeting "Heil Hitler," even as a joke, is undeniably odd behavior for the leader of a country — but then again, Rafael Correa is a pretty unusual head of state.

Correa, in power since 2007, is part of a Latin American tradition of fire-breathing populist, leftist leaders. He relishes the spotlight, is charismatic and bombastic (and sometimes impulsive), and often positions himself as a fearless champion of the people willing to take on everyone from internal enemies to the American imperialists.

But in practice, Correa has used his populist zeal as a cover for his authoritarianism. He is eroding Ecuador's democracy, jailing critical journalists, and persecuting political enemies. That is why others in Latin America, such as former president Hurtado and Panama's Cochez, are so worried about him.

It's not fair to call him a "fascist" — there is a long spectrum of authoritarianism, and Correa is nowhere near the Hitler end of it. But Correa, along with the leaders of fellow Bolivarian Alliance members Venezuela and Cuba, is a leading member of what the Washington Post's Juan Forero in 2012 called "Latin America's new authoritarians," whom he described as nationalistic, populist and "increasingly undemocratic."

This is why Correa loves getting into very public spats: the more time he spends fighting with others, the more he can position himself as a vanguard of change and resistance against Ecuador's enemies, rather than an increasingly oppressive guardian of the status quo. That has allowed him to rally his supporters around the cause of nationalism and has provided a handy rationale for targeting journalists and political opponents. In the runup to his 2009 reelection, for example, Correa purged several top military and intelligence officials, implying that they were American spies.

In February, Correa engaged in a spat with television host John Oliver, who had mocked Correa's practice of reacting angrily to critical Ecuadorian media coverage. Correa responded, of course, with a long series of tweets deriding Oliver. It was, in many ways, a win for both of them: Oliver got to call attention to the Ecuadorian leader's authoritarian, and Correa got another of the enemies he craves.

WATCH: 'How politicians rig elections'