ISTANBUL — The websites of an atheist association, the French satirical newspaper Charlie Hebdo and a Kurdish separatist organization are blocked to Turkish Internet users. But many sites that promote extreme Islamist messages — even some that are outright sympathetic to the Islamic State, the militant organization that has marauded through Iraq and Syria — escape Turkey’s censors.

A hallmark of the decade-long leadership of Turkey’s president, Recep Tayyip Erdogan, and his Islamist Justice and Development Party, or A.K.P., has been a crackdown on freedom of expression. Yet what Turkey chooses to censor reflects the Islamist values of the government, critics say. With the rise of the Islamic State, also known as ISIS or ISIL, this dynamic has been set in sharp relief, highlighting the deep divide between Turkey and its Western allies in the fight against the militants.

The contradictions are often striking, as Turkey largely maintains a hands-off approach to extremist Islamist expression while widely cracking down on other speech. Last year, for instance, Twitter fielded more requests from Turkey to remove material than from any other country. And lately, a beauty queen, a top newspaper editor, an actor, a teenage boy and dozens of others have been targeted by prosecutors for insulting Mr. Erdogan.

At the same time, one prominent site, Takva Haber, a widely used forum for recruiting Turks to the Islamic State, operates freely. It is also a popular news site for jihadists, and it recently offered tips to fighters in Iraq and Syria about how to avoid being spotted by drones from the American-led coalition carrying out an air campaign against the militants.