What did Erdogan know, and when did he know it?

An off-duty police officer named Mevlut Mert Altintas, screaming “Allahu akbar” and making the raised index finger gesture that has come to be a signal of allegiance to the Islamic State (ISIS), murdered Andrey Karlov, the Russian ambassador to Turkey, at an art exhibit in Ankara on Monday. Altintas was reportedly a “member of the special ops unit in Ankara” – raising the question of what did Turkish President Recep Tayyip Erdogan know, and when did he know it?

As he murdered Karlov, Altintas shouted: “Allahu akbar (God is greatest). Do not forget Aleppo! Do not forget Syria! Do not forget Aleppo! Do not forget Syria!” Russia, of course, has greatly aided the Assad regime to retake Aleppo and driving jihadi “rebels” back. Altintas’ Islamic State signal, unless it was a deliberate feint, could have indicated that he was loyal both to Erdogan and to ISIS, both of which are arrayed against Russia.

Erdogan hates Assad and has vowed to unseat him; what’s more, there are numerous indications that he wants to co-opt the Islamic State into a new Ottoman caliphate. His contempt for Kemalist secularism, and consistent and determined efforts to erode it away, have been noted for years. Also frequently noted is the fact that Erdogan has frequently been accused of “neo-Ottoman” tendencies – that is, of wanting to restore the caliphate. Turkey, after all, was the home of the last caliphate, the Ottoman Empire. It is highly possible, therefore, that Erdogan sees the Islamic State less as an enemy than an opportunity: he may envision it defeating his other enemies, such as the Kurds and Assad’s Alawite regime in Damascus, or at least holding them at bay until the opportunity arises for him to move in and reap the benefits of the Islamic State’s activities, transferring the seat of its caliphate to Istanbul, and perhaps even installing himself as the caliph.

That scenario would explain why in September 2014, Erdogan’s Turkey refused to sign a pledge committing the nations of the Persian Gulf region to fighting the Islamic State, even though that pledge was so toothless as to specify that the participating nations were only committing to fighting ISIS to the extent that each deemed “appropriate.”

Around the same time, Barack Obama and John Kerry have failed in repeated efforts to persuade the Turkish government to move against the Islamic State’s black market in oil. Turkish authorities explained that 49 Turkish diplomats were being held hostage in the Islamic State, and claimed that if Turkey struck ISIS too hard, those diplomats would be endangered. The Pentagon even spotted oil tanker trucks moving Islamic State oil in Turkish territory, but declined to strike them for fear of further weakening what was not much more than a paper alliance at that point and is even weaker now.

But Erdogan is clearly much more concerned about the Russians than about the Americans. After all, Barack Obama agrees with him that Assad must be toppled before there can be any effective action against the Islamic State. The Russians, on the other hand, are aiding Assad as a bulwark against the Islamic State, thereby thwarting Erdogan’s caliphate dreams and eroding what he would take over if he were able ultimately to co-opt the ISIS caliphate.

So did Erdogan order the assassination of Andrey Karlov? After Erdogan was widely accused, with considerable justification, of engineering a coup attempt against himself several months ago so as to give himself a pretext to move against his political enemies, this possibility cannot be dismissed.

And even if none of this is the case, and Erdogan had nothing to do with Karlov’s murder, the rapid re-Islamization of Turkey, and its fundamental realignment as an Islamic state rather than a Western-oriented secular one, cannot be denied. Accordingly, even the fact that Turkey is still considered by U.S. officials to be an ally against the Islamic State manifests the crying need for a thoroughgoing reevaluation and realignment of U.S. foreign policy, which is still based on old Cold War models, procedures, and alliances that not only do not apply to the struggle against the global jihad and against the Islamic State in particular, but are actively counterproductive.

As the swamp is drained in Washington, the sham alliance with Turkey needs to be seriously reexamined.

Robert Spencer is the director of Jihad Watch and author of the New York Times bestsellers The Politically Incorrect Guide to Islam (and the Crusades) and The Truth About Muhammad. His latest book is The Complete Infidel’s Guide to Iran. Follow him on Twitter here. Like him on Facebook here.