As the U.S. State Department performs all sorts of semantic gymnastics to avoid defining the Egyptian army’s ouster of the country’s Islamist President Mohamed Morsi as a coup, politicians in Turkey have not only recognized it as such but also condemned it in the strongest possible terms. In a speech on July 5, Turkish Prime Minister Recep Tayyip Erdogan refused to split hairs, insisting that “no matter where or against whom, coups are damaging and inhuman, and directed against the people, the national will and democracy.” He also took Western countries to task for insisting that Egyptians’ disaffection with Morsi, as well as the sheer scale of the recent protests against him, justified, in some sense, his overthrow. “There is no such a thing as a democratic coup,” Erdogan quipped. “It is as much a paradox as the living dead.” By refusing to call things by their name, he added, the West, and the E.U. in particular, “had once again disregarded its own principles.”

Even before Egypt’s military brass served Morsi with a 48-hour ultimatum — the prelude to their intervention — Turkish officials rushed to the embattled Egyptian President’s defense. In Istanbul, the youth branch of the ruling Justice and Development Party (AKP) called on its followers to attend pro-Morsi rallies. Several of these have since taken place in conservative neighborhoods across the city. For a while — and thanks in no small part to a number of AKP officials who took to Twitter to get out the message — #TurkeyWithMorsi was one of the most trending hashtags in Turkey. Today, with Morsi in detention, and with the specter of civil war hovering over the Arab world’s biggest country, the Turkish government appears to be the only major regional player still loyal to Egypt’s deposed President.

Aside from its insistence that a government, once elected, can only be deposed through the ballot box, Ankara has a number of other reasons to stand by Morsi. In January 2011, as Egyptians took to the streets to call for the overthrow of their previous President, Hosni Mubarak and as the West sat on the fence, it was Turkey that fired the first diplomatic salvo by calling on Mubarak to step down. With Morsi and the Muslim Brotherhood in the driver’s seat as of 2012, Erdogan feted the new President in Ankara during a party convention, promised Morsi’s government $2 billion in loans and encouraged Turkish businessmen to invest in Egypt. In the coming weeks, he was planning to pay a long-anticipated visit to the Gaza Strip, which would have seen him transit through Cairo.

To the AKP and its supporters, Morsi’s 2012 election represented not only the triumph of democracy but also of political Islam, which forms their own party’s ideological backbone. Morsi’s removal a year later at the hands of the army — AKP sympathizers have downplayed the role of mass protests that preceded the military’s intervention — reminds many of them of a dark era in Turkey’s own history, when politicians governed at the mercy of generals.

Last month, Turkey faced its own wave of antigovernment protests, with tens of thousands pouring into Istanbul’s streets, decrying Erdogan’s authoritarian streak. Even if these didn’t compare with the unrest in Egypt, many Turkish officials portrayed them as something tantamount to a failed coup. In addition, a number of AKP bigwigs, including Erdogan himself, have accused Western powers, the international media, plus what the Prime Minister cryptically refers to as the “interest-rate lobby” of stoking the unrest. Just last week, the Deputy Prime Minister, Besir Atalay, pointed to “the Jewish diaspora” as yet another potential culprit. Though his comments were registered on video, Atalay has since denied making them. Meanwhile, sporadic protests in Istanbul and elsewhere continue.

Similar rhetoric has surfaced when describing the events in Egypt. While the government is yet to produce any convincing evidence of a foreign hand in the June protests — despite an ongoing investigation into the matter by the national intelligence agency — many of its supporters have been quick to draw parallels between events in Cairo and Istanbul. Progovernment newspapers that likened the anti-Erdogan protests to the Turkish army’s dismantling of an Islamist government in 1997 have since cast the events in Egypt in exactly the same light. Likewise, some have accused outside powers of having a hand in Morsi’s ouster. In a Twitter post, Turkey’s Finance Minister Mehmet Simsek referred to the West as “pro–coup d’état.” At one of the pro-Morsi rallies in Istanbul, a sign read, “They failed in Turkey, now they’re trying to play the same game in Egypt.”

Egypt has also become a rallying point for many of Erdogan’s opponents. To them, post–Arab Spring Egypt — a country where an Islamist party’s attempted to consolidate power across all state institutions, failed to give its political opponents a fair hearing and pursued a religious agenda — mirrors transformations in Turkey, which has been ruled by the Erdogan government since 2002, only at a much faster pace. “As in Egypt, we have a government that has been trying to impose its own constitution and its own outlook on other segments of society, disregarding diversity,” says Semih Idiz, a popular commentator. The recent protests against Erdogan, he adds, “are a direct product of this.” On July 4 the leader of Turkey’s main opposition party, Kemal Kilicdaroglu, drove home the same point by arguing that politicians weren’t entitled to do whatever they pleased simply because they commanded a majority in parliament, and that “democracy wasn’t merely about the ballot box.” A day later, he called Morsi’s fall “a lesson” for Erdogan. “There is no place in democracies for those who use religion as a tool to score political points,” he said. “No one should place himself between man and God.”

Of course, many of the comparisons made by either side of the Turkish political spectrum appear wide off the mark. Morsi’s commitment to Islamism is much more radical than Erdogan’s more moderate approach. The Turkish economy has thrived under the AKP, while the Egyptian one has plummeted to new depths amid the political instability that surrounded Morsi’s tenure. In Egypt, the army remains a powerful actor. In Turkey, through a combination of legislative reforms, carefully screened appointments and the arrests of top generals on conspiracy charges, the AKP has brought it to heel under civilian rule. The Turkish military toppled four democratically elected governments since 1960, and there is no appetite for another coup, even among the AKP’s most stalwart opponents. Tellingly, all of the major political parties, even those with no sympathy for Morsi whatsoever, have condemned his removal from power. “A coup, however it comes about, whoever carries it out, is the single most serious obstacle to democracy,” Kilicdaroglu has said. “A coup is a coup.”

Yet the events in Egypt may have given Erdogan some food for thought, figures Idiz. During his Friday speech, the normally unyielding, self-assured Prime Minister made a very uncharacteristic concession. “Every politician is liable to make mistakes,” he said, “myself included.” To Idiz, the acknowledgment, or “political Freudian slip”, as he put it, was a sign that Turkey’s leadership was beginning to chew on one of the key messages to come out of Egypt: “That if you try to impose a majoritarian interpretation on a diverse society, you’ll end up with social strife.” He added, “Egypt is beginning to make people think. After what happened, and once the dust settles, the situation in Turkey won’t be the same either.”