Speculation has abounded in recent months that one key motivation Turkey may have had to buy Russian S-400 missile defence systems despite strong opposition from Washington is to protect itself from its own planes in the event of another coup attempt.

On the night of July 15, 2016, Turkey’s putschists flew the country’s U.S.-made F-16s to bomb parliament in Ankara – the first time the city came under military attack since 1402 – and even had Turkish President Recep Tayyip Erdoğan’s plane in their sights, but failed to shoot for unknown reasons. Rallying to regain control, the military forces of Erdoğan’s government failed to intercept or shoot down a single one of its rogue jets.

“What was noticed during the 2016 coup attempt is that Turkey did not have any effective defence mechanism against ‘its own’ American-made weaponry!” foreign policy analyst Ali Demirdas noted in The National Interest last month, as Ankara began to receive the first S-400 shipments.

“There’s some talk that (Erdoğan) wants the system just to protect himself,” Reuters quoted a U.S. official as saying. “He doesn’t want a NATO-integrated system.”

While the 2016 coup attempt may have convinced Erdoğan that he needed a non-NATO system, Turkey had pursued non-Western air defence missiles long before the coup. In 2013, Turkey expressed an interest in buying China’s FD-2000 system, which is based on the S-400’s older brother, the S-300.

But Ankara became disillusioned when Beijing was hesitant over transferring technology, something Turkey invariably seeks when purchasing military hardware. Before that purchase was canceled in 2015, Turkey’s NATO allies warned it against buying that system from China for nearly the same reason they warned it against buying the S-400.

“Turkey has been seeking a long range air defence system for more than a decade,” Omar Lamrani, senior military analyst at Stratfor, told Ahval. “This need was reinforced with the outbreak of the Syrian civil war and the realisation that Turkey had little defence against ballistic missiles that the Syrian government had in its possession.”

Lamrani said the choice of a non-NATO country had nothing to do with the coup attempt. “The decision to go with the Russian S-400 is primarily linked to the significant tech transfer that came with the deal as well as Ankara's desire to improve its relationship with Russia,” he said.

Timur Akhmetov, an Ankara-based researcher for the Russian International Affairs Council, saw the S-400 purchase as part of an independent foreign policy and a move toward its long-standing goal to build a strong domestic defence industry.

“Turkey desires to acquire technologies to spur its own defence capabilities in relevant sectors,” he told Ahval.

Joseph Trevithick, a defence writer at The War Zone, is dubious about the coup attempt theory.

“I find it difficult to believe that it was a primary factor in the decision to acquire the S-400 from a capability standpoint,” he told Ahval. “All you have to do is look at the number of times NATO members have deployed air defence assets to Turkey since 1990.”

Turkey has never had a long-range air defence system and has thus had to rely on NATO allies to deploy their Patriot missiles on Turkish soil, as they have done several times in the past 30 years.

Levent Özgül, an Ankara-based defence and geopolitics analyst, took a different view.

“I am one of the analysts strongly defending the argument that Turkey’s S-400 purchase was to protect it against another possible coup attempt involving Turkish F-16s,” he said. “I have previously suggested that the S-400s would be located on Murted airbase, which supports this theory.”

The first components of Turkey’s S-400s were delivered by Russian aircraft to Murted airbase in Ankara. The F-16s that bombed Turkish parliament during the coup attempt took off from Murted, then called Akinci.

Özgül expected Turkey to use the first S-400 battery to protect Ankara and the presidential palace and the second to protect against strikes from Syria, Israel or NATO allies, while the third is likely to be based in Istanbul and protect the Aegean zone.

Özgül acknowledged that defending against a possible coup was not the only reason behind Turkey’s S-400 purchase. He said Washington’s alliance in Syria with the Kurdish-led People’s Protection Units (YPG), which Ankara views as a terrorist group, had led Turkey’s ruling Justice and Development Party (AKP) to view the United States as a potential threat.

“The AKP has decided to move towards independent politics and away from the 70-year NATO alliance,” he said.