This piece was created in collaboration with the Atlantic Council, where Robbie Gramer is currently associate director of the Transatlantic Security Initiative. The views expressed are solely those of the author.

The attempted coup in Turkey shocked leaders across the countries of the NATO alliance. Turkey has been a member of the alliance since 1952, three years after NATO’s inception. Recently, it has become the alliance’s conduit to the troubled Middle East and an integral member of the transatlantic anti-ISIS coalition.

NATO, an alliance based on the transatlantic values of democracy, freedom, and human rights, has grown incredibly uneasy over Turkish President Recep Tayyip Erdogan’s response to the coup. In recent days, he has purged sectors of the government, including the military, the Ministry of Education, and the judiciary branch. Erdogan talks of reinstituting the death penalty to punish the coup plotters, and the president is consolidating power in a way that dismantles many elements of Turkey’s already weak democratic system.

Turkey, U.S. Secretary of State John Kerry said, is veering away from NATO’s “requirement with respect to democracy.” Many interpreted this as a veiled threat that NATO could reassess its relationship with Turkey -- that it could even revoke membership. But Ankara’s worrying backslide from democracy will not change Turkey’s status as a member of NATO.

A coup in a NATO member country, while shocking, is not without precedent. Since joining NATO in 1952, Turkey has undergone four successful military coups that the alliance accepted in stride without jeopardizing Turkey’s membership status -- the most recent took place in 1997. Beyond Turkey, other NATO members have faced coups that in the did not threaten the long-term security or vitality of the organization: a failed coup in France in 1961 in the wake of the disastrous war of independence in Algeria; a successful military coup in Greece in 1967 that lead to seven years of military rule; a failed coup in Italy in 1970; and a successful military coup in Portugal in 1974.

This attempted coup in Turkey comes right on the heels of NATO’s seminal Warsaw Summit, and against the backdrop of worrying new threats across Europe’s periphery, from a revanchist Russia to an emboldened ISIS. But NATO has weathered coups both failed and successful, and that experience indicates the alliance can do so again. As NATO Secretary General Jens Stoltenberg said this week, “Turkey is a valued NATO ally with whom I stand in solidarity in this difficult time.”

What Turkey Means to NATO

The transatlantic community needs Turkey’s help to confront the most challenging security environment in Europe since the end of the Cold War, and President Erdogan knows it. Turkey is a valuable contributor to the military campaign against the Islamic State. It is the primary launch pad for coalition airstrikes against ISIS and training missions for anti-ISIS factions operating in Iraq and Syria. The Incirlik Air Base in southeast Turkey is a vital hub for the U.S.-led campaign. Furthermore, the base houses roughly 50 nuclear weapons, integral to the United States’ deterrence posture in the wider Middle East. Power has been cut off to the base since the coup, underscoring how vulnerable this strategic asset is to internal political strife in Turkey.

Beyond the fight against ISIS, NATO needs Turkey to shore up its military posture in the Black Sea region. Russia’s annexation of Crimea at the onset of the Ukraine crisis dramatically transformed NATO’s relationship with Russia. From the Baltic region to the Black Sea, NATO is struggling to grapple with Russia’s military revanchism and to shore up a strong military and deterrence posture that protects its exposed allies on the Eastern flank. The Black Sea region has become strategically important to the alliance. Russia has loaded the Crimean peninsula with anti-air defense infrastructure, begun upgrading its aging Black Sea fleet, and even talked of stationing nuclear weapons on the peninsula, endangering NATO’s southeastern flank. Turkey is the dominant actor in the region. It exercises full control over access to the Black Sea through the Bosporus and has the strongest navy on the Black Sea. NATO cannot secure its dominant posture in the Black Sea without Turkey.

And finally, Turkey has played a key role in quelling (if not fully curbing) the migrant crisis in Europe. The wave of refugees and migrants that have flooded into Europe from the Middle East and North Africa has fueled a nearly existential political crisis across the European Union, straining the social fabric of EU countries, accelerating the rise of nativist anti-establishment political parties, stoking public anger and discord with the Union’s failed migration policies, and exposing Europe to new terrorist threats. To confront this, the European Union brokered an agreement with Ankara under which Turkey retains a bulk of the migrants and refugees attempting to enter the EU in exchange for financial assistance, visa liberalization for Turkish citizens, and reopening Turkey’s stalled accession process to the European Union.

The anti-ISIS coalition, strategically important American and NATO bases in Turkey, NATO’s posture toward Russia, and the EU’s migration deal would all be at risk if NATO forced Turkey out. Given the array of threats the alliance faces, NATO could not afford to put any of this at risk.

Furthermore, NATO has no system in place for a member state to leave, willingly or forcibly. If it ever came to that point, that doesn’t preclude NATO from forging such a procedure. But the process would be long, arduous, and politically traumatizing to an alliance already struggling with unity and with complex security challenges. NATO is far from reaching that point with Turkey, given its important geopolitical and military role.

The EU’s foreign policy chief, Federica Mogherini, said the failed coup is “no excuse to take the country away from fundamental rights and the rule of law, and we will be extremely vigilant on that.” And German Foreign Minister Frank-Walter Steinmeier said that reintroduction of the death penalty for coup plotters “would prevent [Turkey’s] successful negotiations to join the EU.” But Turkey’s prospects of joining the EU were already slim, and the Union has few tools at its disposal to substantially punish Ankara’s backslide from democracy as long as it remains reliant on Turkey to help mitigate its migration crisis.

Secretary Kerry’s intonations, if not misinterpreted, will not come to fruition. Turkey is too important to NATO and European security. The failed coup presented President Erdogan with an opportunity to consolidate his control over Turkey and dismantle many of the country’s democratic institutions. Rhetorical threats of reassessing NATO membership or Turkey’s relationship with the European Union will do little to change Erdogan’s mind or alter his political calculations.

If Erdogan’s power grab continues unabated, NATO will have to confront a very uncomfortable conflict between its twin commitments to shared democratic values and shared security. Turkey is proving that the two may be mutually exclusive.