The president of Turkey is getting his Putin on.

Recep Tayyip Erdogan looks less like the custodian of democracy for a crucial American ally hoping to join Europe and more like a nasty, crafty autocrat. More like … Vladimir Putin.

Who needs this guy? Well, the West does. And Erdogan knows it. Turkey, a NATO member, is key to the fight against the Islamic State, and to managing the Syrian refugee crisis. But that doesn’t mean the United States and European Union should shrug off his troubling predilection for lashing out at perceived foes.

Last week the Turkish government steamrolled the country’s biggest newspaper, Zaman, silencing an Erdogan critic and violating the country’s tenuous commitment to press freedom. Trustees were appointed to run Zaman, the editor-in-chief was fired, and riot police made a show of force inside and outside the newspaper’s offices. When it was over, Zaman’s formerly lively front page reported that Erdogan had visited a bridge under construction, but made no mention of the newsroom coup. Yes, from government critic to government mouthpiece, overnight.

Like Russia’s authoritarian president, Erdogan is a dominating figure, elected but intolerant of dissent. He led Turkey as prime minister; although the presidency is a supposedly ceremonial post, he reigns as the country’s strongman.

In the past two years, Turkey’s justice ministry has opened as many as 1,845 criminal cases against citizens accused of insulting the president. In one case, a doctor lost his job for comparing Erdogan to the creature Gollum in “Lord of the Rings.” Teens have been charged for ripping down Erdogan posters, or posting unwelcome Facebook comments. Journalists are particular targets: Two from another opposition publication, Cumhuriyet, face serious charges for reporting on alleged arms smuggling to Syria.

Turkey is a partner with the U.S. in the war on terrorism, but Erdogan has his own agenda. His main concern, besides burnishing his own image, is putting down a homegrown insurrection against Kurdish rebels. That has made Erdogan a reluctant ally in Syria because the most capable U.S. allies on the ground there are Syrian Kurds. It’s tough to count on the Turks, in other words, when they view our friends as their enemies.