Even by President Recep Tayyip Erdoğan’s standards, the diplomacy – if you can call it that –  on show at his meeting with US President Donald Trump last Wednesday was brazen.

US Republicans and pundits alike were rightly baffled by the warm reception offered to the Turkish strongman, who in recent weeks has defied the US and its NATO ally in numerous and galling ways.

Trump, however, lavished praise on his Turkish counterpart – declaring he was a “big fan” of the Turkish autocrat.

It was all pretty disconcerting, considering on the face of it, relations between the two allies really couldn’t be worse.

Putting aside the ongoing list of Turkey’s gross human rights violations and its affront to democracy (which, let’s face it, Trump is not all that interested in defending), let’s start with Erdoğan’s most recent bird.

It’s hard to understate the audacity of buying an advanced weapons system from Russia, when Turkey makes up the second largest force in NATO – an alliance established explicitly to provide collective security against Moscow.

After the US announced it was pulling out of Syria, Turkey took the opportunity to invade Syria and attack the US’s vulnerable Kurdish allies, who had been pivotal in defeating ISIS, with Turkey completely ignoring pleas, threats, and the warnings from Trump in an infamous letter not to be a “tough guy”.

Turkey invaded anyway, unleashing its military might against the Kurds in a move that all but pushed the Kurds towards Assad, handing the Syrian president an easy victory and possibly paving the way for Islamic State’s return. It was a swift undoing of years of hard work, military effort, and investment that had Trump’s republican colleagues railing.

But Trump’s accommodation of this brazen manoeuver is not all that surprising, considering his pledge to get America out of “endless wars”. His willingness to throw allies under a bus is well documented, as is his disdain for the Kurds.

Turkey also announced last week it was repatriating hundreds of foreign jihadists it has in its custody. Some have already been flown back to Europe, and at least one has been sent back to the United States.

Hosting more than 3.5 million Syrian refugees, Turkey has long used the refugees as leverage over Europe, threatening to open the floodgates to exact concessions from Europe on offshore drilling in the Mediterranean and aid. Now the 959 militants it is housing offer a new bargaining chip.

A camp for Syrian refugees in Turkey, 2016. The country currently hosts more than 3.5 million Syrians who have fled their homes (Photo: European Parliament/Flickr)

Ankara has criticised European nations for refusing to take their own nationals back, with Interior Minister Süleyman Soylu stating Turkey would not be a “hotel for foreign terrorists”.

It’s pretty rich, considering Turkey’s open-house policy played an essential role in the creation and growth of Al Qaeda and ISIS in Syria. Thousands of foreign fighters slipped back and forth across its southern border unimpeded and set up shop in southern Turkish cities and towns throughout the period 2012–15, drawing consternation from the US and Europe. Now, sensing they offer a point of leverage, Turkey claims it doesn’t want them any more.

This week, The Weekend Australian reported Turkey is also pressuring the Morrison government to repatriate three Australian nationals captured as Islamic State members. Turkey’s Ambassador to Australia, Korhan Karokoc, suggested the Australian government was reluctant to have them back.

Trump has previously pushed for the return of foreign fighters, calling European nations a “tremendous disappointment” for their failure to bring ISIS militants home, and has threatened to dump them on their borders. Just days after the meeting with Trump, Erdoğan did exactly that – dumping one of America’s homegrown terrorists on US soil.

And despite the central Trump administration policy objective of countering Iran, precious little was made at the meeting of the fact of Turkey’s deepening economic ties to Iran.

But most perplexing about the meeting is the fact that absolutely no headway was made to resolve the most thorny matter of Turkey’s purchase of a Russian missile defence system. Erdoğan purchased the advanced S-400 missile batteries from Russia in a two-part, US$2.5 billion deal, the delivery of which was completed in September.

Russian S-400 surface-to-air missile systems (Photo: Sergei Malgavko/TASS via Getty Images)

It’s hard to understate the audacity of buying an advanced weapons system from Russia, when Turkey makes up the second largest force in NATO – an alliance established explicitly to provide collective security against Moscow.

The US responded by initially blocking Turkey’s purchase of US F-35 fighter jets. Trump reportedly tried, unsuccessfully, to convince Erdoğan not to activate the battery. Erdoğan announced it would indeed be activated, in the days immediately following the meeting.

There is now strong momentum in the US to pass a resolution, already approved by the House of Representatives, to sanction Turkey over the purchase. Last month, the US suggested Turkey would be spared sanctions if the missile system was not turned on, but in another apparent slap in the face, Erdoğan’s spokesman on Friday told the Turkish state broadcaster there was no stepping back from the purchase, insisting the batteries would be activated.

Sanctioning a key NATO ally is hardly an ideal scenario. Once upon a time, the Turkish model was held high as an example of the compatibility of democracy and Islam, offering the US a convenient, strategically placed ally bridging Europe and the Middle East. As Turkey made efforts to join the European Union, interests appeared to converge.

But under Erdoğan, those interests have moved apart. After initially taking a strong line against Syrian President Assad at the start of the revolutionary movement there in 2011, Turkey made a strategic about-face in 2014 to priortise its long-standing position against Kurdish separatism, its relationship with Russia, and its economic ties to Iran and the east. Erdoğan has also played on anti-American and Israeli sentiment at home, to his electoral advantage. 

In fact, Turkey’s role as ally has been wearing thin for some time. As there is no mechanism to eject a NATO member, sanctions may have to do.

Given all this, there has been much media speculation around the reason for Trump’s effusive reception for Erdoğan.

The New York Times published an investigation into Trump’s familial and business ties to Turkey that appeared to play to both presidents’ nepotism.

Commentators have pointed to Trump’s penchant for bad guys and underdogs, in the same vein as his pursuit of Kim Jong-un.

As is often the case, the most compelling explanation for Trump’s baffling behaviour is likely domestic. Erdoğan’s visit came the same week as impeachment hearings began in the US.

What better distraction from those events than hammering home success on one of Trump’s key election pledges: get out of the Middle East? And Erdoğan gave Trump just the ticket to do so.