After a multi-day artillery barrage, the Turkish Army has begun its push into Afrin, a district of Syria which has been governed by Syrian Kurds ever since they defeated al Qaeda and Islamic State terrorists. Turkish officials say they plan to set up a buffer zone extending almost 20 miles into Syria from the Turkish border. Turkish President Recep Tayyip Erdogan gave a blistering speech threatening Turkey’s Kurds if they speak up on behalf of their Syrian counterparts and promising victory within “a very short period of time.”

That may be a fatal miscalculation, one which could cripple Turkey. Erdogan’s paranoia and political meddling in the military have taken a toll. Once the pride of NATO, the Turkish military and security services are a shadow of their former self. They lack the experience, training, and discipline of their predecessors. One in four Turkish pilots is in prison; many Turkish F-16s are grounded for lack of trained pilots. In 2012, Syrian forces downed a Turkish F-4, and Kurds have downed Turkish helicopters.

Nor is it clear the Turkish army can fight effectively. The Turks may occupy pockets in Syria, but their presence has long been more symbolic than real. One of the reasons the Turkish intelligence service (MIT) supplied and supported the al Qaeda-affiliated Nusra Front and allowed the Islamic State free transit across Turkish territory was a quid pro quo in order to protect Turkish interests inside Syria. In short, Erdogan wanted to assume the status of military commander without actually having to fight the tough battles that originally elevated Mustafa Kemal Ataturk, founder of the Republic of Turkey, to prominence.

Turkey’s competence gap can be seen in the few incidents where Turkish forces have come into contact with adversaries in Syria or Iraq. In 2016, the ISIS burned to death two Turkish soldiers that it captured in Syria. That ISIS terrorists were able to kidnap them in the first place demonstrates massive security lapses, and that Turkey was unable to determine their location prior to their execution reflects gaps in Turkish intelligence. Rather than acknowledge their murder, Erdogan responded as he often does with denial and deflection, refusing to acknowledge the accuracy of the video and then imposing a media blackout on the murders.

Turkey’s weakness is also reflected in deteriorating internal security. Terrorists have for decades targeted Turkey, but Turkish security forces successfully exposed and disrupted terrorist plots. After Erdogan purged senior military and security officials and rotated others out of territories and portfolios they knew inside-out, terrorism surged not only inside Turkey but even in the once-safe cities of Istanbul and Ankara. This should not have been unexpected to any leader cognizant of history. The Red Army hemorrhaged effectiveness after Soviet dictator Josef Stalin purged the officer corps prior to the Nazi invasion during World War II. Iraqi inroads into Iran in 1980 were due not only to the element of surprise, but also to Ayatollah Ruhollah Khomeini’s hobbling of the Iranian officer corps during his post-revolutionary purge. More recently, ISIS seized Mosul after former Iraqi Prime Minister Nouri al-Maliki replaced more professional officers with political loyalists who chickened out and ran at the sound of the first shot.

Turkey has fought the PKK since 1984. The group suffered a blow in 1999 when Turkish commandos, perhaps assisted by U.S. or Israeli intelligence, seized PKK leader Abdullah Ocalan. While Turkish officials for more than a decade insisted the imprisoned and isolated Ocalan has become irrelevant, Erdogan transformed him into an indispensable Kurdish political leader by agreeing to negotiate peace with him. Erdogan may like to depict the PKK as terrorists — and, without doubt, they have engaged in terrorism — but in recent years, they have transformed themselves into more of a traditional insurgency. And while the links between the PKK and the Syrian-based Popular Mobilization Units (YPG) are real, Turkish officials are hard-pressed to attribute any attacks inside Turkey to Syrian Kurds from Afrin.

But while Turkey’s military is a shadow of its former self, the same can’t be said for the YPG. The Kurdish militia has been the most effective fighting force on the ground in Syria against al Qaeda and ISIS. For years, they operated alone — ignored by the United States and Russia, isolated by other Syrian opposition groups, and embargoed by Turkey. And yet, at Kobane and elsewhere, their discipline, high morale, and cohesion paid off. If they could operate against all odds against ISIS, they can likewise be a formidable opponent against Turkey, especially with home field advantage.

Nor is the PKK amateurish, especially after years of hardening in battle. In another incident censored by Turkey, PKK operatives managed to capture two of Turkey’s leading intelligence officials.

Nor are Turkey’s aims clear. There is hardly a Kurdish farmer or shopkeeper that Turkish officials — in assessments blinded by racism and ignorance — don’t see as terrorists. If Turkey seeks to wipe out “terrorists,” does that mean engaging in ethnic cleansing inside Syria? And, if that happens, what is to stop a blowback that will not only send hundreds of Turkish troops back home in body bags, but will also ignite the already repressed Kurdish population inside Turkey? If Turkey has been unable to defeat the PKK in Diyarbakir and Hakkari, will they be able to do so in Istanbul and Antalya? Just as Erdogan’s forces once supplied al Qaeda and ISIS with weaponry, what might happen if other countries — Russia, Israel, the Syrian regime, or even the United States — decide covertly to provide the means for the YPG to better defend themselves? If Kurds bring the fight into Turkey, can Turkey’s economy survive as the multi-billion dollar tourist industry shrinks 75 percent?

Erdogan operates in a domain of ego and ambition unencumbered by reality. He brands those who question him as terrorists, and so top aides understand they must tell him only what he wishes to hear. The result, now that Turkish forces are moving into Afrin against an opponent stronger than Erdogan realizes, could be disaster for Turkey. Erdogan may expect a quick victory. Not only is this not realistic, but he may soon find that what he sees as an ignorant terrorist group is strong enough to bleed Turkish invaders dry and run the Turkish economy into the ground.

Erdogan may set the stage not for triumphant victory but for a defeat that will shake Turkey to the core.

Michael Rubin (@Mrubin1971) is a contributor to the Washington Examiner's Beltway Confidential blog. He is a resident scholar at the American Enterprise Institute and a former Pentagon official.

If you would like to write an op-ed for the Washington Examiner, please read our guidelines on submissions here.