WASHINGTON -- The spectacle of rogue military maneuvers in Istanbul's streets, an air bombardment of Turkey's parliament in Ankara and the surrender of soldiers on the Bosphorus Bridge took Washington by complete surprise on Friday night, as US officials scrambled to figure out who was behind a coup against Turkey's sitting president.It took a few hours, but US President Barack Obama and Secretary of State John Kerry swiftly resolved to publicly support the "democratically elected government" of President Tayyip Erdogan, a juggernaut in Turkish politics for 14 consecutive years.So too did Hillary Clinton, the presumptive Democratic presidential nominee, as well as UN Secretary-General Ban Ki-moon and virtually every foreign secretary in the Western world.Shortly before the White House weighed in, Erdogan resorted to FaceTime to call on millions of his supporters to "take to the streets" in violation of a junta-declared curfew– in the name of democracy and the rule of law, the president proclaimed.For Erdogan to emerge from this event as a democratic standard-bearer would be the greatest defeat of all for those behind it, since their justification for the coup d'etat was that Erdogan, in fact, is slowly eroding the country's founding Kemalist principles.Those principles include republicanism, populism and secularism– principles that Erdogan has been disregarding as he embraces Islamist political factions, suppresses free speech and calls for an executive presidency untethered by parliament."What makes the Turkish military unique is that it sees itself as having an almost sacred duty to protect an indigenous ideology, namely Kemalism, the principles laid down by the founder of the Turkish republic, Kemal Ataturk," writes Turkey scholar Gareth Jenkins in his book, Context and Circumstance: The Turkish Military and Politic. "This ideological dimension to the military's perception of its role has meant that its definition of security extends beyond public order and Turkey's political or economic interests to include threats to the country's Kemalist legacy." And yet Erdogan has been democratically elected, repeatedly, in elections monitored and verified by the Organization for Security and Co-Operation in Europe. The protesters in the street were right to say that Erdogan was freely elected.Whether he was elected fairly is a different matter: Erdogan has stifled the ability of his critics to reach the people by fighting newspapers outside his party line and public access to social media platforms.As the coup was still under way, close aides to Erdogan were pointing their fingers at members of the Gülen– a movement in Turkey that preaches Islam as compatible with modernity. Critics of the movement, including Erdogan since a sudden fallout with the group 2013, accuse Gülen followers of attacking the purely secularist constitution of Ataturk.Gülen denies this, and has thus far denied any role in Friday's coup attempt. Kerry has asked the Erdogan government for evidence to back up its claim that Gülen members are behind the attack. Regardless of their involvement, it is a convenient narrative for Erdogan, who would prefer to define the coup as an attempt to undermine Kemalist values– not as an effort to uphold them.Responding to a question last month on the Erdogan government's detention of journalists, the State Department's spokesperson, John Kirby, expressed concern."As Turkey’s friend and ally, we urge the authorities there to ensure their actions uphold the universal democratic values enshrined in the Turkish constitution, which includes freedom of speech," Kirby said. "In a democratic society, we believe that critical opinions should be encouraged, not silenced. We believe democracies become stronger, not weaker, by allowing the expression of diverse voices within society." This is the Erdogan dilemma: That a democratically elected leader is gaining electoral support for– or perhaps in spite of– his hostility to democratic institutions. Military insurgents failed to cast him as an enemy of democracy for this reason, and in their failure, they have all but guaranteed the consolidation of power they sought to prevent.