A decade ago, Western and Israeli leaders could count on Turkey as an ally. A solid NATO member, Ankara took decisions based on pragmatic calculations of interest - and erred on the side of caution if at all. But under the rule of the Islamic conservative AKP, this has changed.

In the face of Hamas rockets, Israel could have expected more understanding from a country long suffering from aggressive PKK terrorism. The vehemence with which Turkish leaders attacked Israel, and their apparent willingness to convey Hamas' position to the United Nations, came as a surprise to many.

Some of this may be explained by pandering to the Islamic conservative AKP's hard-core base. But Prime Minister Tayyip Erdogan's words - that Israel's actions will be punished by God and help lead it to self-destruction - are too significant to be taken lightly. Indeed, they are part of the trend of a Turkish government guided more by Islamic solidarity and anti-Western sentiment than by pragmatic calculations of interest. Indeed, Turkey's international behavior suggests that its attachment to the West is tenuous at best - and eroding.

SINCE COLD WAR times, Turkey played a solid role as the southeastern anchor of NATO. When president Turgut Özal decided to participate in Operation Desert Storm in 1990, he made Turkey a regional power in its own right, putting an end to talk of the country's reduced strategic value in the aftermath of the Cold War.

Under successive governments in the 1990s, Turkey built strong relations with Israel, which branched out from the defense sector to culture, trade and tourism. This served both countries well. In the new states of the Caucasus and Central Asia, Ankara was alongside Washington one of the most powerful Western forces, coordinating policies with the US to mutual benefit.

Of course, the policy had its detractors. Turkey's Islamists strongly disapproved not only of ties to Israel, but also of the attention given to former Soviet nations, which they considered inferior Muslims compared to their own role models in the Middle East. When briefly in government in 1996, the Islamists tried in vain to reorient the country's foreign policy.

When Erdogan's AKP came to power in 2002, it portrayed itself as a very different brand of Islamists - as post-Islamists, in fact. Where his predecessors had shunned the EU, Erdogan embraced it; his rhetoric was free of the anti-Semitism and anti-Americanism of his forebears. Yet after half a decade in power, Erdogan's policies and rhetoric have slipped dangerously.

Ankara's differences with Washington over Iraq in 2002-03 are widely known, but differed little from stances adopted by Germany or other European allies. Nevertheless, Turkish policies on a whole range of issues since then illustrate how dramatically the country has changed.

IN AUGUST, when most of the West balked at Russia's invasion of Georgia, Erdogan rapidly tried to make himself a go-between. His initiative of a "Caucasus stability platform" was met with disbelief in both Georgia and Azerbaijan, since it effectively promised to freeze all territorial disputes in the region, including legitimizing Russia's recent territorial grab in Georgia. More worrying was the composition of Erdogan's intended platform: the three Caucasian states, Turkey - and Russia. The US and EU had not been consulted, neither did they apparently figure in Erdogan's calculations for this region, effectively amounting to a recognition of Moscow's imperial ambitions. This, in turn, came following Turkey's alignment with Russia on the issue of NATO's presence in the Black Sea.

Ankara's position on Iran has been similarly equivocal. When in Washington recently, Erdogan observed that "those who ask Iran not to produce nuclear weapons should give up their own nuclear weapons first" - a position that fits neither with Turkey's membership in the Non-Proliferation Treaty or NATO.

More broadly, Erdogan has in recent years shown a remarkable willingness to meet with rogue regimes. Ankara's improving relationships with Syria and Iran are understandable, given that they are neighbors with which Turkey needs to work. But its decision to welcome Sudanese President Omar al-Bashir with full honors in January 2008, or to invite Hamas leader Khaled Mashaal to the AKP party headquarters in 2006, cannot be explained away simply by pragmatic decisions born out of necessity. Indeed, these decisions need to be seen in the context of the AKP's gradual change, with Islamic self-identification gaining ground in both domestic and foreign policy. Since reelection in 2007, the AKP has focused more on the advancement of Islamic values in Turkey's society and state than on democratic reform. In foreign policy, Islamic solidarity and anti-Western sentiment have gained ground - which in turn influence the views of society at large, making Turkey as a nation less Western.

This is the broader context in which Turkey's reaction to the Gaza crisis should be seen. It does not signify that Turkey will become an enemy either of Israel or of the West - Ankara's deep links to the US and Europe are too strong to be reversed anytime soon. But as long as the AKP remains in power, these ties are likely to gradually erode even further. Rather than a part of the West, Turkey could rather become equidistant between the West and powers like Russia or Iran. Were that to happen, it would require strategic thinkers in Washington, Brussels and Tel Aviv to reconsider some of their earlier assumptions.

The writer is research director of the Central Asia-Caucasus Institute and Silk Road Studies Program, a joint center affiliated with Johns Hopkins University-SAIS and the Institute for Security and Development Policy, Stockholm. A graduate of Ankara's Middle East Technical University, he is the editor-in-chief of the center's biweekly journal, Turkey Analyst (www.turkeyanalyst.org).