Ever since Turkey joined NATO in 1952, Ankara has viewed its membership in alliance as a win-win proposition, where NATO enhances Turkey's security and contributes to its integration with the Euro-Atlantic community, and in return, Turkey assumes its responsibilities in defending the interests of the alliance.

But the past few years have put much strain on the relationship, as NATO proves unable or unwilling to stem the tide of mounting regional instability caused by the rise of the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group against the backdrop of the civil wars in Iraq and Syria on Turkey's doorsteps.

And last week, the failed coup seemed to deepening distrust between Turkey and its NATO allies.

US Secretary of State John Kerry warned that exploiting the coup to crack down on its detractors and undermine its democracy, could cost Turkey its NATO membership.

But regardless of the seriousness of the US warning - and I think it's not serious - will Ankara continue to be part of NATO, especially when its attempts to join the European Union have all but failed?

Asset or burden?

The US has long embraced Turkey as a strategic asset, regardless of the latter's abuse of democracy.

For decades, Washington has maintained close strategic relations with Ankara despite - or thanks to - four military coups, in 1960, 1971, 1980, 1997, and even after its invasion of Cyprus in 1974.

But reading the mainstream Western media gives the impression that Turkey under the Erdogan administration has become hostile to Western interests; a "strategic liability", an "irresponsible loose cannon", or a "reckless, aggressive ally" and a "fifth column".

Is any of this true?

Not according to retired NATO Supreme Allied Commander James Stavridis. He argued in a recent Foreign Policy magazine expose that Turkey has been present in "virtually every NATO operation with significant impact: training Afghan Security Forces and leading coalition efforts in the central district, including Kabul; sending ships and aircraft to Libya; participating in counterpiracy operations; maintaining a steady presence in the security and peacekeeping force in the Balkans".

Contrary to huffs and puffs coming out of Washington and Paris, Turkey's experience shows that its NATO membership guarantees it can do what it pleases internally as long as it serves US and NATO externally.

Moreover, according to Stavridis - who is considered by Hillary Clinton as a running mate - Turkey has an "enormous ability" to influence events, "from the Islamic State to Syria; Israel to oil and gas in the eastern Mediterranean; responding to radical Islam to stability in Egypt".

In short, the record shows that Turkey under the Erdogan administration has been a major NATO asset; indeed, it's been more of a benefactor than benefiter from the alliance.

Enthusiastic member

The Justice and Development Party (AK party) seems as enthusiastic for doing NATO's bidding if not more than its secular nationalist predecessors; or even its Western allies. And it sees a new, greater role for itself and NATO in the Middle East moving forward.

Since NATO's first "out of area" operations in Afghanistan in 2001, Turkey has argued that it's best situated to contribute to such interventions considering the instability in the greater Middle East area.

OPINION: Turkey US - What's the problem?

Former Turkish Foreign and Prime Minister Ahmet Davutoglu went further to urge Europe to support change in the Middle East as it did in Eastern Europe, and vowing that "Turkey will continue to be an asset and an influential actor within NATO if future needs arise, or further NATO involvement in the Middle East" (PDF).

But that, in my view, is not necessarily constructive for Turkey or the Middle East region. Certainly not after the invasions of Afghanistan and Iraq, and not when Turkey is treated as a foot soldier in an alliance of powerful Western states.

OPINION: Turkey - Coup 'silence' and pointing fingers at the West

Despite repeated terrorist attacks in Istanbul and other Turkish cities, Turks feel as though their specific worries and interests are "not respected" within the North Atlantic Council.

Instead of being friends and allies on equal terms, the US and its European allies continue to speak down at Recep Tayyip Erdogan's Turkey - most recently France's foreign minister, who was told to mind his own business.

All of which begs the question: what happens if Ankara is suspended or it breaks away from the alliance?

The alternative and its consequences

If Turkey leaves NATO, the risks to its security are minimal. It has a bigger military and higher defence spending than any one of its neighbours or its NATO allies, with the exception of the US.

True, its relations with its neighbours aren't great, but Ankara has tried to improve them over the past few weeks and months, especially by mending fences with Israel and Russia.

In fact, before the coup, Turkey was reportedly heading, once again, towards a more pragmatic non-interventionist "zero-problems" diplomacy towards its neighbours.

But one can't say the same for NATO; the alliance will suffer if Turkey quits.

First, it'll be exposed for being a military club of influential, predominantly Christian nations with grave consequences to its out-of-area operations.

Second, NATO will find it far more challenging, if not totally improbable, to win the war against ISIL.

Third, if Turkey were to destabilise, the repercussions would be grave for Europe, and could potentially strengthen ISIL.

Fourth, It will embolden Russia to act more aggressively in the region. And fifth, the US and NATO would lose their five major military facilities in Turkey.

So will Turkey leave NATO?

Realistically, Turkey doesn't have solid alternative options to NATO or the EU.

The Organization of Islamic Cooperation (OIC) is more of a forum than anything resembling an alliance. And the same goes for BRICS.

Yet, for all the practical purposes, the Erdogan administration has almost given up on its EU membership in frustration, and is moving further away from it as it rejects the EU's demands to revise its anti-terror laws and potentially legalise capital punishment.

But Ankara will hang tight to its NATO membership - more for its political than military benefits.

Contrary to huffs and puffs coming out of Washington and Paris, Turkey's experience shows that its NATO membership guarantees it can do what it pleases internally as long as it serves US and NATO externally.

Judging from President Barack Obama's phone call to President Erdogan this week, the US is holding tight to its Turkish ally. Likewise, if Admiral Starvidis's recommendations are anything to go by, so will Clinton.

So as Erdogan strengthens his grip over the country's military and political establishment, Turkey and NATO will continue to embrace each other, and probably increase visit exchanges, improve their lines of communications and intensify the cooperation against ISIL.

Marwan Bishara is the senior political analyst at Al Jazeera. Follow him on Facebook.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.