On March 18, European and Turkish diplomats signed off on a comprehensive deal on migrants pouring from Syria, Iraq, and elsewhere in the Middle East through Turkey and into the European Union. Under the terms of the deal, for every illegal migrant the E.U. returns to Turkey, Turkey would send one refugee for resettlement in Europe. Additionally, Turkey and Europe agreed to re-open discussions concerning the Muslim country’s efforts to join the E.U., and Europe agreed to allow Turks visa-free travel throughout the Schengen zone.

Two days after the deal was announced, a Turk who had joined the Islamic State blew himself up among tourists on Istanbul’s Istiklal Street, one of the city’s major shopping and tourism districts. Two days after that, ISIS suicide bombers killed dozens in two separate attacks in Brussels. ISIS called what occurred in Belgium "a drop in the sea" compared with what the terrorists have in store for "nations of disbelief."

Turkey and its president, Recep Tayyip Erdoğan, have used the growing threat to argue that the West must better conform its policies to Turkey’s desires. In the wake of the Brussels attacks, Prime Minister Ahmet Davutoğlu chided Europe. "Europe has no partner other than Turkey to provide its regional security," he declared, adding a subtle threat: "They should see this reality and act accordingly." Meanwhile President Obama will welcome Erdoğan to Washington this week for a strategy meeting about countering the ISIS.

The reality Davutoğlu deliberately ignores, however, is his own country’s role in allowing ISIS to develop and metastasize. The Turkish government is adept at pulling the wool over Western officials’ eyes. Erdoğan pays lip service in meetings with European and American officials to the importance of both democracy and the Turkish partnership with the West, for example, declaring, "Secularism is the protector of all beliefs and religions." He speaks differently to his Turkish audience. As mayor of Istanbul, he described himself as "the imam of Istanbul" and declared, "Thank God almighty, I am a servant of Shari‘a." He is famous for his quip, "Democracy is like a streetcar. When you come to your stop, you get off." In recent years, he has declared his goal to be to "raise a religious generation."

This "religious generation" is flowing into the cauldron of Syria and Iraq. More than 30,000 foreign fighters from as many as 100 countries now fight with the Islamic State. The bulk of these soldiers—perhaps 90 percent—crossed into the Islamic State from Turkey. Turkish visa policy contributes to the problem. A direct correlation can be drawn between foreign fighters serving ISIS and those nationalities from which Turkish authorities require no visa or provide waivers: Several thousand more Moroccans and Tunisians, who need no visas to transit Turkey, fight with ISIS in Syria and Iraq than Algerians and Libyans, who do. If Erdoğan simply required visas in advance for those under the age of 40 coming from countries like Morocco, Tunisia, Lebanon, and Jordan—or, for that matter, from Russia, the United Kingdom, and Australia—the flood of recruits into the Islamic State would slow to a trickle.

ISIS terrorists regularly traverse the Turkish border, not only for medical care but also for rest and relaxation. Some merchants in Istanbul openly sell ISIS propaganda and promise that proceeds from their sale will benefit the group’s fight in Syria and Iraq. Smugglers peddling contraband oil to fund ISIS rely on Turkey to bring the oil to market, paying off local and perhaps even national officials of the AKP, Turkey’s governing party, along the way.

Turkey has done more than lend passive support to Islamist radicals. In his 13 years in power, Erdoğan has transformed Turkey from a Western-leaning democracy into Pakistan-on-the-Mediterranean. There was, for example, the leak of documents from the Millî İstihbarat Teşkilatı (MİT), Turkey’s intelligence service, showing Turkish support of the Nusra Front, an al Qaeda affiliate operating in Syria. And, rather than give medals to the Turkish soldiers who intercepted truckloads of weaponry destined for Syrian radicals, Erdoğan ordered their arrest.

Likewise, when Turkish journalists exposed—with photographic evidence—the transfer of munitions and other supplies from the Turkish border to ISIS, Erdoğan’s response was not to applaud the media but to seize the newspaper and arrest its editors and many of its reporters.

There is also evidence that, as Kurds fighting ISIS in Kobani in 2014 began to turn the tide against the radical group, Erdoğan and Turkish intelligence officials allowed ISIS fighters to pass through Turkey and attack Kobani from across the border, a flank the town’s largely Kurdish residents assumed was secure.

From the beginning, Erdoğan has looked at the Syrian refugee crisis not as a humanitarian tragedy but an arrow in his quiver. Inside Turkey, he has offered Sunni refugees Turkish citizenship if they settle in Turkish provinces currently dominated by the Shi‘ite offshoot Alevi sect. And, whereas the world condemns ISIS "genocide" against the Yezidi, the Yezidi who sheltered in Turkey were then victimized, again, by local AKP-run municipalities who refused to provide services offered to Sunni refugees.

Allowing Turkey to choose which refugees to send to Europe and promising to eliminate visa restrictions for Turks only rewards Erdoğan for his behavior and gives him additional leverage in his dealings with the West. Nor is this the type of policy Erdoğan’s neighbors would support. Earlier this year, King Abdullah II of Jordan told Congress, "The fact that terrorists are going to Europe is part of Turkish policy and Turkey keeps on getting a slap on the hand, but they are let off the hook." He added that, "radicalization was being manufactured in Turkey."

Abdullah’s message fell on deaf in ears in Washington, Brussels, Paris, and Berlin. It is Erdoğan who has the initiative as he pursues the Islamicization of Turkey and neo-Ottoman imperialism. He has built a Pakistan on the Mediterranean: an incubator of terror that markets itself as the only available partner of the West, with tragic results.