Once the apotheosis of a pro-Western, dependable Muslim democracy, this week Turkey officially left the Western alliance and became a full member of the Iranian axis.

It isn't that Ankara's behavior changed fundamentally in recent days. There is nothing new in its massive hostility toward Israel and its effusive solicitousness toward the likes of Syria and Hamas. Since the Islamist AKP party first won control over the Turkish government in the 2002 elections, led by AKP chairman Recip Tayyip Erdogan, the Turks have incrementally and inexorably moved the formerly pro-Western Muslim democracy into the radical Islamist camp populated by the likes of Iran, Syria, Hizbullah, al-Qaida and Hamas.

What made Turkey's behavior this week different from its behavior in recent months and years is that its attacks were concentrated, unequivocal and undeniable for everyone outside of Israel's scandalously imbecilic and flagellant media.

Until this week, both Israel and the US were quick to make excuses for Ankara. When in 2003 the AKP-dominated Turkish parliament prohibited US forces from invading Iraq through Kurdistan, the US blamed itself. Rather than get angry at Turkey, the Bush administration argued that its senior officials had played the diplomatic game poorly.

In February 2006, when Erdogan became the first international figure to host Hamas leaders on an official state visit after the jihadist group won the Palestinian elections, Jerusalem sought to explain away his diplomatic aggression. Israeli leaders claimed that Erdogan's red carpet treatment for mass murderers who seek the physical destruction of Israel was not due to any inherent hostility on the part of the AKP regime toward Israel. Rather, it was argued that Ankara simply supported democracy and that the AKP, as a formerly outlawed Islamist party, felt an affinity toward Hamas as a Muslim underdog.

Jerusalem made similar excuses for Ankara when during the 2006 war with Hizbullah Turkey turned a blind eye to Iranian weapons convoys to Lebanon that traversed Turkey; when Turkey sided with Hamas against Israel during Operation Cast Lead, and called among other things for Israel to be expelled from the UN; and when Erdogan caused a diplomatic incident this past January by castigating President Shimon Peres during a joint appearance at the Davos conference. So, too, Turkey's open support for Iran's nuclear weapons program and its galloping trade with Teheran and Damascus, as well as its embrace of al-Qaida financiers have elicited nothing more than grumbles from Israel and America.

Initially, this week Israel sought to continue its policy of making excuses for Turkish aggression against it. On Sunday, after Turkey disinvited the IAF from the Anatolian Eagle joint air exercise with Turkey and NATO, senior officials like Deputy Foreign Minister Danny Ayalon and opposition leader Tzipi Livni tried to make light of the incident, claiming that Turkey remains Israel's strategic ally.

But Turkey wasted no time in making fools of them. On Monday, 11 Turkish government ministers descended on Syria to sign a pile of cooperation agreements with Iran's Arab lackey. The Foreign Ministry didn't even have a chance to write apologetic talking points explaining that brazen move before Syria announced it was entering a military alliance with Turkey and would be holding a joint military exercise with the Turkish military. Speechless in the wake of Turkey's move to hold military maneuvers with its enemy just two days after it canceled joint training with Israel, Jerusalem could think of no mitigating explanation for the move.

Tuesday was characterized by escalating verbal assaults on the Jewish state. First Erdogan renewed his libelous allegations that Israel deliberately killed children in Gaza. Then he called on Turks to learn how to make money like Jews do.

Erdogan's anti-Israel and anti-Semitic blows were followed on Tuesday evening by Turkey's government-controlled TRT1 television network's launch of a new prime-time series portraying IDF soldiers as baby- and little girl-killers who force Palestinian women to deliver stillborn babies at roadblocks and line up groups of Palestinians against walls to execute them by firing squad.

The TRT1 broadcast forced Israel's hand. Late on Tuesday, the Foreign Ministry announced it was launching an official protest with the Turkish Embassy. Unfortunately, it was unclear who would be coming to the Foreign Ministry to receive the demarche, since Turkey hasn't had an ambassador in Israel for three weeks.

TURKEY'S BREAK with the West; its decisive rupture with Israel and its opposition to the US in Iraq and Iran was predictable. Militant Islam of the AKP variety has been enjoying growing popularity and support throughout Turkey for many years. The endemic corruption of Turkey's traditional secular leaders increased the Islamists' popularity. Given this domestic Turkish reality, it is possible that Erdogan and his fellow Islamists' rise to power was simply a matter of time.

But even if the AKP's rise to power was eminently predictable, its ability to consolidate its control over just about every organ of governance in Turkey as well as what was once a thriving free press, and change completely Turkey's strategic posture in just seven years was far from inevitable. For these accomplishments the AKP owes a debt of gratitude to both the Bush and Obama administrations, as well as to the EU.

The Bush administration ignored the warnings of secular Turkish leaders in the country's media, military and diplomatic corps that Erdogan was a wolf in sheep's clothing. Rather than pay attention to his past attempts to undermine Turkey's secular, pro-Western character and treat him with a modicum of suspicion, after the AKP electoral victory in 2002 the Bush administration upheld the AKP and Erdogan as paragons of Islamist moderation and proof positive that the US and the West have no problem with political Islam. Erdogan's softly peddled but remorselessly consolidated Islamism was embraced by senior American officials intent on reducing democracy to a synonym for elections rather than acknowledging that democracy is only meaningful as a system of laws and practices that engender liberal egalitarianism.

In a very real sense, the Bush administration's willingness to be taken in by Erdogan paved the way for its decision in 2005 to pressure Israel to allow Hamas to participate in the Palestinian elections and to coerce Egypt into allowing the Muslim Brotherhood to participate in its parliamentary poll.

In Turkey itself, the administration's enthusiastic embrace of the AKP meant that Erdogan encountered no Western opposition to his moves to end press freedom in Turkey; purge the Turkish military of its secular leaders and end its constitutional mandate to preserve Turkey's secular character; intimidate and disenfranchise secular business leaders and diplomats; and stack the Turkish courts with Islamists. That is, in the name of its support for its water-downed definition of democracy, the US facilitated Erdogan's subversion of all the Turkish institutions that enabled liberal norms to be maintained and kept Turkey in the Western alliance.

As for the Obama administration, since entering office in January it has abandoned US support for democracy activists throughout the world, in favor of a policy of pure appeasement of US adversaries at the expense of US allies. In keeping with this policy, President Barack Obama paid a preening visit to Ankara where he effectively endorsed the Islamization of Turkish foreign policy that has moved the NATO member into the arms of Teheran's mullahs. Taken together, the actions of the Bush and Obama White Houses have demoralized Westernized Turks, who now believe that their country is doomed to descend into the depths of Islamist extremism. As many see it, if they wish to remain in Turkey, their only recourse is to join the Islamist camp and add their voices to the rising chorus of anti-Americanism and anti-Semitism sweeping the country.

Then there is the EU. For years Brussels has been stringing Turkey along, promising that if it enacts sufficient human rights reforms, the 80-million strong Muslim country will be permitted to join Europe. But far from inducing more liberal behavior on the part of Turkey, those supposedly enlightened reforms have paved the way for the Islamist ascendance in the country. By forcing Turkey to curb its military's role as the guarantor of Turkish secularism, the EU took away the secularists' last line of defense against the rising tide of the AKP. By forcing Turkey to treat its political prisoners humanely and cancel the death penalty, the EU eroded the secularists' moral claim to leadership and weakened their ability to effectively combat both Kurdish and Islamist terror.

At the same time, by consistently refusing to permit Turkey to join the EU, despite Ankara's moves to placate its political correctness, Brussels discredited still further Turkey's secularists. When after all their self-defeating and self-abasing reforms, Europe still rejected them, the Turks needed to find a way to restore their wounded honor. The most natural means of doing so was for the Turks writ large to simply turn their backs on Europe and move toward their Muslim brethren.

FOR ITS part, as the lone Jewish state that belongs to no alliance, Israel had no ability to shape internal developments in Turkey. But still, Turkey's decision to betray the West holds general lessons for Israel and for the free world as a whole. These lessons should be learned and applied moving forward not only to Turkey, but to a whole host of regimes and sub-national groups in the region and throughout the world.

In the first instance it is crucial for policy-makers to recognize that change is the only permanent feature of the human condition. A country's presence in the Western camp today is no guarantee that it will remain there in the future. Whether a regime is democratic or authoritarian or somewhere in the middle, domestic conditions and trends play major roles in determining its strategic posture over time. This is just as true for Turkey as it is for the US, for Iran and for Sweden and Egypt.

The loss of Turkey shows that countries can and do change. The best way to influence that change is to remain true to one's friends, even if those friends are imperfect. Only by strengthening those who share one's country's norms and interests - rather than its procedures and rhetoric - can governments exert constructive influence on internal changes in other states and societies.

Moreover, it is only by being willing to recognize what makes an ally an ally and an adversary an adversary that the West will adopt policies that leave it more secure in the long run. A military-controlled Turkish democracy that barred Islamists from political power was more desirable than a popularly elected AKP regime that has moved Turkey into the Iranian axis. So, too, a corrupt Western-dependent regime in Afghanistan is more desirable than a Taliban-al-Qaida terror state. Likewise an unstable, weakened mullocracy in Iran challenged by a well-funded, liberal opposition is preferable to a strong, stable mullocracy that has successfully repressed its internationally isolated liberal rivals.

Turkey is lost and we'd better make our peace with this devastating fact. But if we learn its lessons, we can craft policies that check the dangers that Turkey projects and prepare for the day when Turkey may decide that it wishes to return to the Western fold.